@instructure/quiz-core 20.36.2 → 20.38.0
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/AddToBankModal/presenter.js +1 -2
- package/es/banks/components/AsyncSearch/index.js +1 -2
- package/es/banks/components/BankEntry/presenter.js +1 -2
- package/es/banks/components/BankSearch/presenter.js +1 -3
- package/es/banks/components/Banks/index.js +0 -1
- package/es/banks/components/Banks/presenter.js +5 -9
- package/es/banks/components/CopyMoveBankEntryModal/presenter.js +1 -2
- package/es/banks/components/CreateBankModal/presenter.js +1 -2
- package/es/banks/components/EditBankModal/presenter.js +1 -2
- package/es/banks/components/NavWrapper/externalStyles.js +5 -0
- package/es/banks/components/NavWrapper/styles.js +4 -3
- package/es/banks/components/SharingModal/RootAccountSharing.js +1 -2
- package/es/banks/components/SharingModal/ShareList/index.js +1 -2
- package/es/banks/components/SharingModal/index.js +0 -2
- package/es/banks/components/SharingModal/presenter.js +18 -78
- package/es/building/api/stimuli.js +2 -1
- package/es/building/components/resources/DeleteStimulusModal/presenter.js +14 -7
- package/es/building/components/resources/quizEntry/QuizEntry/presenter.js +11 -4
- package/es/building/components/resources/quizEntry/QuizEntryEdit/Footer/presenter.js +1 -2
- package/es/building/components/resources/quizEntry/QuizEntryEdit/Header/index.js +40 -23
- package/es/building/components/resources/quizEntry/QuizEntryEdit/Header/styles.js +1 -29
- package/es/building/components/resources/quizEntry/QuizEntryEdit/Header/theme.js +1 -5
- package/es/common/actions/modifications.js +3 -2
- package/es/common/components/AccessCodeTextInput/AccessCodeTextInput.stories.js +11 -0
- package/es/common/components/AccessCodeTextInput/index.js +47 -0
- package/es/common/components/ImportModal/presenter.js +1 -2
- package/es/common/components/MaskedTextInput/MaskedTextInput.stories.js +19 -0
- package/es/common/components/MaskedTextInput/index.js +64 -0
- package/es/common/components/layout/Page/styles.js +7 -4
- package/es/common/components/layout/Page/theme.js +1 -2
- package/es/common/components/layout/header/Calculator/presenter.js +2 -2
- package/es/common/components/layout/navbar/externalStyles.js +7 -0
- package/es/common/components/layout/navbar/styles.js +4 -5
- package/es/common/components/layout/sidebar/Sidebar/externalStyles.js +10 -0
- package/es/common/components/layout/sidebar/Sidebar/index.js +26 -4
- package/es/common/components/layout/sidebar/Sidebar/styles.js +4 -6
- package/es/common/components/layout/sidebar/SidebarItem/presenter.js +13 -7
- package/es/common/components/layout/sidebar/Stimulus/presenter.js +14 -7
- package/es/common/components/resources/item/ItemEdit/presenter.js +2 -4
- package/es/common/components/resources/quiz/AddContent/Body/presenter.js +2 -2
- package/es/common/components/resources/quiz/instructions/styles.js +8 -6
- package/es/common/components/resources/quiz/instructions/theme.js +1 -2
- package/es/common/components/resources/stimulus/Stimulus/presenter.js +3 -2
- package/es/common/components/resources/stimulus/StimulusEdit/presenter.js +14 -4
- package/es/common/components/resources/stimulus/StimulusEdit/styles.js +1 -5
- package/es/common/components/resources/stimulus/StimulusEdit/theme.js +0 -2
- package/es/common/components/resources/stimulus/StimulusEditInfo/presenter.js +51 -37
- package/es/common/components/resources/stimulus/StimulusShow/index.js +10 -4
- package/es/common/components/resources/stimulus/StimulusShow/styles.js +0 -7
- package/es/common/components/resources/stimulus/StimulusShow/theme.js +0 -3
- package/es/common/components/shared/GenericAsyncSearch/GenericAsyncSearch.js +1 -2
- package/es/common/components/shared/InteractionTypes/index.js +4 -1
- package/es/common/components/shared/InteractionTypes/presenter.js +38 -15
- package/es/common/components/shared/TagSelect/presenter.js +1 -2
- package/es/common/components/shared/TimeUnitsInput/index.js +11 -9
- package/es/common/components/shared/drag_and_drop/dragAndDropUtils.js +3 -0
- package/es/common/records/QuizEntry.js +5 -0
- package/es/common/records/Stimulus.js +2 -1
- package/es/common/reducers/modifications.js +6 -3
- package/es/common/util/warningHelpers.js +15 -5
- package/es/index.js +3 -1
- package/es/moderating/components/resources/AccommodationsModal/ExtraTimeSettings/index.js +2 -2
- package/es/moderating/components/resources/AccommodationsModal/index.js +5 -13
- package/es/moderating/components/resources/ModerateTable/presenter.js +5 -4
- package/es/moderating/components/sidebar/ModerateTray/presenter.js +21 -31
- package/es/reporting/components/resources/NewQuizAndItemAnalysis/AnswerFrequencySummary/MatchingType/MatchingTypeTable/presenter.js +1 -2
- package/es/reporting/components/resources/NewQuizAndItemAnalysis/AnswerFrequencySummary/NumericType/ChoiceTypeWithInfo/presenter.js +1 -1
- package/es/reporting/components/resources/NewQuizAndItemAnalysis/AnswerFrequencySummary/NumericType/presenter.js +1 -2
- package/es/reporting/components/resources/NewQuizAndItemAnalysis/AnswerFrequencySummary/RichFillBlankType/ChoiceGroupTypeTable/presenter.js +1 -2
- package/es/reporting/components/resources/NewQuizAndItemAnalysis/AnswerFrequencySummary/shared/AfsTableWrapper/presenter.js +1 -2
- package/es/reporting/components/resources/NewQuizAndItemAnalysis/AnswerFrequencySummary/shared/AggregationTable/presenter.js +1 -2
- package/es/reporting/components/resources/NewQuizAndItemAnalysis/AnswerFrequencySummary/shared/ChoiceTypeTable/presenter.js +1 -2
- package/es/reporting/components/resources/NewQuizAndItemAnalysis/AnswerFrequencySummary/shared/ExpandableCard/presenter.js +1 -2
- package/es/reporting/components/resources/NewQuizAndItemAnalysis/NewItemAnalysis/presenter.js +1 -2
- package/es/reporting/components/resources/NewQuizAndItemAnalysis/ReportCard/presenter.js +1 -2
- package/es/reporting/components/resources/NewQuizAndItemAnalysis/presenter.js +1 -2
- package/es/reporting/components/resources/ReportCard/index.js +1 -2
- package/es/reporting/components/resources/StudentAnalysis/ReportCard/presenter.js +1 -2
- package/es/reporting/components/resources/common/AnalysisUpdateDate/index.js +1 -1
- package/es/taking/api/taking.js +4 -0
- package/lib/banks/components/AddToBankModal/presenter.js +1 -2
- package/lib/banks/components/AsyncSearch/index.js +8 -9
- package/lib/banks/components/BankEntry/presenter.js +1 -2
- package/lib/banks/components/BankSearch/presenter.js +4 -6
- package/lib/banks/components/Banks/index.js +0 -1
- package/lib/banks/components/Banks/presenter.js +9 -13
- package/lib/banks/components/CopyMoveBankEntryModal/presenter.js +1 -2
- package/lib/banks/components/CreateBankModal/presenter.js +1 -2
- package/lib/banks/components/EditBankModal/presenter.js +1 -2
- package/lib/banks/components/NavWrapper/externalStyles.js +12 -0
- package/lib/banks/components/NavWrapper/styles.js +5 -3
- package/lib/banks/components/SharingModal/RootAccountSharing.js +3 -4
- package/lib/banks/components/SharingModal/ShareList/index.js +3 -4
- package/lib/banks/components/SharingModal/index.js +0 -2
- package/lib/banks/components/SharingModal/presenter.js +20 -80
- package/lib/building/api/stimuli.js +2 -1
- package/lib/building/components/resources/DeleteStimulusModal/presenter.js +14 -7
- package/lib/building/components/resources/quizEntry/QuizEntry/presenter.js +11 -4
- package/lib/building/components/resources/quizEntry/QuizEntryEdit/Footer/presenter.js +3 -4
- package/lib/building/components/resources/quizEntry/QuizEntryEdit/Header/index.js +39 -22
- package/lib/building/components/resources/quizEntry/QuizEntryEdit/Header/styles.js +1 -29
- package/lib/building/components/resources/quizEntry/QuizEntryEdit/Header/theme.js +1 -5
- package/lib/common/actions/modifications.js +3 -2
- package/lib/common/components/AccessCodeTextInput/AccessCodeTextInput.stories.js +20 -0
- package/lib/common/components/AccessCodeTextInput/index.js +57 -0
- package/lib/common/components/ImportModal/presenter.js +1 -2
- package/lib/common/components/MaskedTextInput/MaskedTextInput.stories.js +29 -0
- package/lib/common/components/MaskedTextInput/index.js +74 -0
- package/lib/common/components/layout/Page/styles.js +7 -4
- package/lib/common/components/layout/Page/theme.js +1 -2
- package/lib/common/components/layout/header/Calculator/presenter.js +2 -2
- package/lib/common/components/layout/navbar/externalStyles.js +14 -0
- package/lib/common/components/layout/navbar/styles.js +5 -5
- package/lib/common/components/layout/sidebar/Sidebar/externalStyles.js +17 -0
- package/lib/common/components/layout/sidebar/Sidebar/index.js +25 -3
- package/lib/common/components/layout/sidebar/Sidebar/styles.js +4 -6
- package/lib/common/components/layout/sidebar/SidebarItem/presenter.js +15 -9
- package/lib/common/components/layout/sidebar/Stimulus/presenter.js +16 -9
- package/lib/common/components/resources/item/ItemEdit/presenter.js +2 -4
- package/lib/common/components/resources/quiz/AddContent/Body/presenter.js +2 -2
- package/lib/common/components/resources/quiz/instructions/styles.js +8 -6
- package/lib/common/components/resources/quiz/instructions/theme.js +1 -2
- package/lib/common/components/resources/stimulus/Stimulus/presenter.js +3 -2
- package/lib/common/components/resources/stimulus/StimulusEdit/presenter.js +14 -4
- package/lib/common/components/resources/stimulus/StimulusEdit/styles.js +1 -5
- package/lib/common/components/resources/stimulus/StimulusEdit/theme.js +0 -2
- package/lib/common/components/resources/stimulus/StimulusEditInfo/presenter.js +56 -42
- package/lib/common/components/resources/stimulus/StimulusShow/index.js +9 -3
- package/lib/common/components/resources/stimulus/StimulusShow/styles.js +0 -7
- package/lib/common/components/resources/stimulus/StimulusShow/theme.js +0 -3
- package/lib/common/components/shared/GenericAsyncSearch/GenericAsyncSearch.js +3 -4
- package/lib/common/components/shared/InteractionTypes/index.js +4 -1
- package/lib/common/components/shared/InteractionTypes/presenter.js +38 -15
- package/lib/common/components/shared/TagSelect/presenter.js +4 -5
- package/lib/common/components/shared/TimeUnitsInput/index.js +12 -10
- package/lib/common/components/shared/drag_and_drop/dragAndDropUtils.js +3 -0
- package/lib/common/records/QuizEntry.js +5 -0
- package/lib/common/records/Stimulus.js +2 -1
- package/lib/common/reducers/modifications.js +6 -3
- package/lib/common/util/warningHelpers.js +15 -5
- package/lib/index.js +22 -6
- package/lib/moderating/components/resources/AccommodationsModal/ExtraTimeSettings/index.js +7 -7
- package/lib/moderating/components/resources/AccommodationsModal/index.js +5 -13
- package/lib/moderating/components/resources/ModerateTable/presenter.js +7 -6
- package/lib/moderating/components/sidebar/ModerateTray/presenter.js +21 -31
- package/lib/reporting/components/resources/NewQuizAndItemAnalysis/AnswerFrequencySummary/MatchingType/MatchingTypeTable/presenter.js +6 -7
- package/lib/reporting/components/resources/NewQuizAndItemAnalysis/AnswerFrequencySummary/NumericType/ChoiceTypeWithInfo/presenter.js +9 -9
- package/lib/reporting/components/resources/NewQuizAndItemAnalysis/AnswerFrequencySummary/NumericType/presenter.js +2 -3
- package/lib/reporting/components/resources/NewQuizAndItemAnalysis/AnswerFrequencySummary/RichFillBlankType/ChoiceGroupTypeTable/presenter.js +5 -6
- package/lib/reporting/components/resources/NewQuizAndItemAnalysis/AnswerFrequencySummary/shared/AfsTableWrapper/presenter.js +4 -5
- package/lib/reporting/components/resources/NewQuizAndItemAnalysis/AnswerFrequencySummary/shared/AggregationTable/presenter.js +3 -4
- package/lib/reporting/components/resources/NewQuizAndItemAnalysis/AnswerFrequencySummary/shared/ChoiceTypeTable/presenter.js +3 -4
- package/lib/reporting/components/resources/NewQuizAndItemAnalysis/AnswerFrequencySummary/shared/ExpandableCard/presenter.js +8 -9
- package/lib/reporting/components/resources/NewQuizAndItemAnalysis/NewItemAnalysis/presenter.js +20 -21
- package/lib/reporting/components/resources/NewQuizAndItemAnalysis/ReportCard/presenter.js +9 -10
- package/lib/reporting/components/resources/NewQuizAndItemAnalysis/presenter.js +20 -21
- package/lib/reporting/components/resources/ReportCard/index.js +1 -2
- package/lib/reporting/components/resources/StudentAnalysis/ReportCard/presenter.js +9 -10
- package/lib/reporting/components/resources/common/AnalysisUpdateDate/index.js +2 -2
- package/lib/taking/api/taking.js +4 -0
- package/package.json +9 -12
|
@@ -10,9 +10,9 @@ import { Component } from 'react';
|
|
|
10
10
|
import PropTypes from 'prop-types';
|
|
11
11
|
import ImmutablePropTypes from 'react-immutable-proptypes';
|
|
12
12
|
import partial from 'lodash/partial';
|
|
13
|
+
import { Text } from '@instructure/ui-text';
|
|
13
14
|
import { ScreenReaderContent } from '@instructure/ui-a11y-content';
|
|
14
15
|
import { CondensedButton } from '@instructure/ui-buttons';
|
|
15
|
-
import { TextInput } from '@instructure/ui-text-input';
|
|
16
16
|
import { jsx, Global } from '@instructure/emotion';
|
|
17
17
|
import { FillBlankInteractionType } from '@instructure/quiz-interactions';
|
|
18
18
|
import { IconBankLine } from '@instructure/ui-icons';
|
|
@@ -21,9 +21,10 @@ import { convertFITBtoRich } from "../../../../../../common/util/fitbCopyHelper.
|
|
|
21
21
|
import PositionBox from "../../../../../../common/components/resources/positionBox/PositionBox.js";
|
|
22
22
|
import Item from "../../../../../../common/records/Item.js";
|
|
23
23
|
import ActionButtons from "../../../ActionButtons/index.js";
|
|
24
|
-
import { DELETED_QUIZ_ENTRY, API_INPUT_VALIDATION_ERROR, BUILD_TRAY_OPEN, withStyleOverrides } from '@instructure/quiz-common';
|
|
24
|
+
import { DELETED_QUIZ_ENTRY, API_INPUT_VALIDATION_ERROR, BUILD_TRAY_OPEN, Flex, TextInput, withStyleOverrides } from '@instructure/quiz-common';
|
|
25
25
|
import generateStyle from "./styles.js";
|
|
26
26
|
import generateComponentTheme from "./theme.js";
|
|
27
|
+
import { View } from '@instructure/ui-view';
|
|
27
28
|
var _ref2 = jsx(IconBankLine, null);
|
|
28
29
|
var QuizEntryHeader = (_dec = withStyleOverrides(generateStyle, generateComponentTheme), _dec(_class = (_QuizEntryHeader = /*#__PURE__*/function (_Component) {
|
|
29
30
|
_inherits(QuizEntryHeader, _Component);
|
|
@@ -182,16 +183,19 @@ var QuizEntryHeader = (_dec = withStyleOverrides(generateStyle, generateComponen
|
|
|
182
183
|
}, {
|
|
183
184
|
key: "renderName",
|
|
184
185
|
value: function renderName() {
|
|
185
|
-
|
|
186
|
-
|
|
186
|
+
var isBank = this.props.quizEntry.isBank && this.props.newActiveBank;
|
|
187
|
+
var dataAutomation = 'sdk-quiz-entry-interaction-type';
|
|
188
|
+
if (!isBank) {
|
|
189
|
+
return jsx(Text, {
|
|
187
190
|
size: "small",
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
"data-automation": "sdk-quiz-entry-interaction-type"
|
|
191
|
+
weight: "normal",
|
|
192
|
+
"data-automation": dataAutomation
|
|
191
193
|
}, this.props.name);
|
|
192
194
|
}
|
|
193
|
-
return jsx(
|
|
194
|
-
|
|
195
|
+
return jsx(CondensedButton, {
|
|
196
|
+
size: "small",
|
|
197
|
+
margin: "0 0 0 x-small",
|
|
198
|
+
onClick: this.handleBankClick,
|
|
195
199
|
"data-automation": "sdk-quiz-entry-interaction-type"
|
|
196
200
|
}, this.props.name);
|
|
197
201
|
}
|
|
@@ -211,20 +215,22 @@ var QuizEntryHeader = (_dec = withStyleOverrides(generateStyle, generateComponen
|
|
|
211
215
|
questionNumber: displayPosition,
|
|
212
216
|
interactionType: entry.getInteractionType().name
|
|
213
217
|
});
|
|
214
|
-
return jsx(
|
|
215
|
-
css: this.props.styles.titleHolder
|
|
216
|
-
}, jsx("span", {
|
|
217
|
-
css: this.props.styles.titleInput
|
|
218
|
-
}, jsx(TextInput, {
|
|
218
|
+
return jsx(TextInput, {
|
|
219
219
|
ref: this.storeTitleRef,
|
|
220
|
-
renderLabel: jsx(
|
|
220
|
+
renderLabel: jsx(Flex, {
|
|
221
|
+
direction: "column",
|
|
222
|
+
gap: "small"
|
|
223
|
+
}, jsx(Flex.Item, {
|
|
224
|
+
"aria-hidden": true
|
|
225
|
+
}, this.renderName()), jsx(Flex.Item, {
|
|
226
|
+
"aria-hidden": true
|
|
227
|
+
}, t('Question Title')), jsx(ScreenReaderContent, null, titleLabelText)),
|
|
221
228
|
type: "text",
|
|
222
|
-
placeholder: t('Question Title'),
|
|
223
229
|
onChange: this.handleTitleChange,
|
|
224
230
|
value: workingEntry.title || '',
|
|
225
231
|
interaction: disabled ? 'disabled' : 'enabled',
|
|
226
232
|
"data-automation": "sdk-question-title-textinput"
|
|
227
|
-
})
|
|
233
|
+
});
|
|
228
234
|
}
|
|
229
235
|
}, {
|
|
230
236
|
key: "renderLeftHeader",
|
|
@@ -233,14 +239,16 @@ var QuizEntryHeader = (_dec = withStyleOverrides(generateStyle, generateComponen
|
|
|
233
239
|
position: this.props.displayPosition
|
|
234
240
|
});
|
|
235
241
|
var position = this.props.disabledForRegrade ? this.props.displayPosition : this.props.quizEntry.positionToDisplay(this.props.displayPosition);
|
|
236
|
-
return jsx(
|
|
242
|
+
return jsx(Flex, {
|
|
237
243
|
className: "leftHeader",
|
|
238
|
-
|
|
244
|
+
direction: "row",
|
|
245
|
+
justifyItems: "center",
|
|
246
|
+
"data-automation": "sdk-quiz-entry-left-header"
|
|
239
247
|
}, jsx(PositionBox, {
|
|
240
248
|
position: position,
|
|
241
249
|
headingText: positionText,
|
|
242
250
|
"data-automation": "sdk-quiz-entry-positionbox"
|
|
243
|
-
}), this.renderBankedContent(),
|
|
251
|
+
}), this.renderBankedContent(), jsx("div", {
|
|
244
252
|
css: this.props.styles.dividingLine
|
|
245
253
|
}), this.renderTitleHolder());
|
|
246
254
|
}
|
|
@@ -260,12 +268,21 @@ var QuizEntryHeader = (_dec = withStyleOverrides(generateStyle, generateComponen
|
|
|
260
268
|
shouldDisableDeleteButton: this.props.disabledForRegrade,
|
|
261
269
|
shouldRenderEdit: false
|
|
262
270
|
};
|
|
263
|
-
return jsx(
|
|
271
|
+
return jsx(View, {
|
|
272
|
+
as: "div",
|
|
264
273
|
className: "header",
|
|
265
|
-
|
|
274
|
+
background: "secondary",
|
|
275
|
+
padding: "small"
|
|
266
276
|
}, jsx(Global, {
|
|
267
277
|
styles: this.props.styles.globalStyles
|
|
268
|
-
}),
|
|
278
|
+
}), jsx(Flex, {
|
|
279
|
+
className: "header",
|
|
280
|
+
direction: "row",
|
|
281
|
+
gap: "small"
|
|
282
|
+
}, jsx(Flex.Item, {
|
|
283
|
+
shouldShrink: false,
|
|
284
|
+
shouldGrow: true
|
|
285
|
+
}, this.renderLeftHeader()), jsx(Flex.Item, null, jsx(ActionButtons, actionButtonProps))));
|
|
269
286
|
}
|
|
270
287
|
}]);
|
|
271
288
|
QuizEntryHeader.displayName = "QuizEntryHeader";
|
|
@@ -8,39 +8,11 @@ var generateStyle = function generateStyle(componentTheme) {
|
|
|
8
8
|
},
|
|
9
9
|
header: {
|
|
10
10
|
backgroundColor: componentTheme.headerBackgroundColor,
|
|
11
|
-
color: componentTheme.headerColor
|
|
12
|
-
padding: componentTheme.headerPadding,
|
|
13
|
-
display: 'flex',
|
|
14
|
-
justifyContent: 'space-between',
|
|
15
|
-
verticalAlign: 'middle',
|
|
16
|
-
alignItems: 'center'
|
|
17
|
-
},
|
|
18
|
-
leftHeader: {
|
|
19
|
-
flex: '8 0 0',
|
|
20
|
-
display: 'inline-flex',
|
|
21
|
-
flexWrap: 'nowrap',
|
|
22
|
-
alignItems: 'center',
|
|
23
|
-
/* fix for ie11 */
|
|
24
|
-
width: '100%'
|
|
25
|
-
},
|
|
26
|
-
interactionType: {
|
|
27
|
-
fontSize: componentTheme.interactionTypeFontSize,
|
|
28
|
-
marginLeft: componentTheme.interactionTypeLeftMargin,
|
|
29
|
-
marginRight: componentTheme.interactionTypeRightMargin
|
|
11
|
+
color: componentTheme.headerColor
|
|
30
12
|
},
|
|
31
13
|
dividingLine: {
|
|
32
14
|
width: '0',
|
|
33
15
|
borderLeft: componentTheme.dividingLineLeftBorder
|
|
34
|
-
},
|
|
35
|
-
titleHolder: {
|
|
36
|
-
display: 'flex',
|
|
37
|
-
flex: '1 1 auto'
|
|
38
|
-
},
|
|
39
|
-
titleInput: {
|
|
40
|
-
flex: '1 1 auto',
|
|
41
|
-
fontSize: componentTheme.titleInputFontSize,
|
|
42
|
-
whiteSpace: 'nowrap',
|
|
43
|
-
textOverflow: 'ellipsis'
|
|
44
16
|
}
|
|
45
17
|
};
|
|
46
18
|
};
|
|
@@ -5,11 +5,7 @@ var generateComponentTheme = function generateComponentTheme(_ref) {
|
|
|
5
5
|
return {
|
|
6
6
|
headerBackgroundColor: colors.porcelain,
|
|
7
7
|
headerColor: colors.oxford,
|
|
8
|
-
headerPadding: "".concat(spacing.xSmall, " ").concat(spacing.small)
|
|
9
|
-
interactionTypeFontSize: typography.fontSizeSmall,
|
|
10
|
-
interactionTypeLeftMargin: spacing.xSmall,
|
|
11
|
-
interactionTypeRightMargin: spacing.xSmall,
|
|
12
|
-
titleInputFontSize: typography.fontSizeMedium
|
|
8
|
+
headerPadding: "".concat(spacing.xSmall, " ").concat(spacing.small)
|
|
13
9
|
};
|
|
14
10
|
};
|
|
15
11
|
export default generateComponentTheme;
|
|
@@ -474,13 +474,14 @@ export function clearTemporaryBankItem(bankId) {
|
|
|
474
474
|
// =====================
|
|
475
475
|
// =====================
|
|
476
476
|
|
|
477
|
-
export function createStimulus(quizId, position) {
|
|
477
|
+
export function createStimulus(quizId, position, isPassage) {
|
|
478
478
|
return function (dispatch, getState) {
|
|
479
479
|
dispatch({
|
|
480
480
|
type: CREATE_TEMPORARY_STIMULUS,
|
|
481
481
|
payload: {
|
|
482
482
|
quizId: quizId,
|
|
483
|
-
position: position
|
|
483
|
+
position: position,
|
|
484
|
+
isPassage: isPassage
|
|
484
485
|
}
|
|
485
486
|
});
|
|
486
487
|
};
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { AccessCodeTextInput } from "./index.js";
|
|
3
|
+
export default {
|
|
4
|
+
title: AccessCodeTextInput.name
|
|
5
|
+
};
|
|
6
|
+
var _ref = /*#__PURE__*/React.createElement(AccessCodeTextInput, {
|
|
7
|
+
value: "Is it secret? Is it safe?"
|
|
8
|
+
});
|
|
9
|
+
export var whenRendered = function whenRendered() {
|
|
10
|
+
return _ref;
|
|
11
|
+
};
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
import _classCallCheck from "@babel/runtime/helpers/esm/classCallCheck";
|
|
2
|
+
import _createClass from "@babel/runtime/helpers/esm/createClass";
|
|
3
|
+
import _inherits from "@babel/runtime/helpers/esm/inherits";
|
|
4
|
+
import _createSuper from "@babel/runtime/helpers/esm/createSuper";
|
|
5
|
+
import React, { Component } from 'react';
|
|
6
|
+
import MaskedTextInput from "../MaskedTextInput/index.js";
|
|
7
|
+
import { ScreenReaderContent } from '@instructure/ui-a11y-content';
|
|
8
|
+
import t from '@instructure/quiz-i18n/es/format-message';
|
|
9
|
+
export var AccessCodeTextInput = /*#__PURE__*/function (_Component) {
|
|
10
|
+
_inherits(AccessCodeTextInput, _Component);
|
|
11
|
+
var _super = _createSuper(AccessCodeTextInput);
|
|
12
|
+
function AccessCodeTextInput() {
|
|
13
|
+
var _this;
|
|
14
|
+
_classCallCheck(this, AccessCodeTextInput);
|
|
15
|
+
for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
|
|
16
|
+
args[_key] = arguments[_key];
|
|
17
|
+
}
|
|
18
|
+
_this = _super.call.apply(_super, [this].concat(args));
|
|
19
|
+
_this.state = {
|
|
20
|
+
masked: true
|
|
21
|
+
};
|
|
22
|
+
_this.handleMaskedChange = function () {
|
|
23
|
+
_this.setState(function (state) {
|
|
24
|
+
return {
|
|
25
|
+
masked: !state.masked
|
|
26
|
+
};
|
|
27
|
+
});
|
|
28
|
+
};
|
|
29
|
+
return _this;
|
|
30
|
+
}
|
|
31
|
+
_createClass(AccessCodeTextInput, [{
|
|
32
|
+
key: "render",
|
|
33
|
+
value: function render() {
|
|
34
|
+
return /*#__PURE__*/React.createElement(MaskedTextInput, Object.assign({
|
|
35
|
+
renderLabel: /*#__PURE__*/React.createElement(ScreenReaderContent, null, t('Access Code')),
|
|
36
|
+
display: "inline-block",
|
|
37
|
+
type: "text",
|
|
38
|
+
onMaskedChange: this.handleMaskedChange,
|
|
39
|
+
masked: this.state.masked,
|
|
40
|
+
checkboxLabel: t('Show access code')
|
|
41
|
+
}, this.props));
|
|
42
|
+
}
|
|
43
|
+
}]);
|
|
44
|
+
AccessCodeTextInput.displayName = "AccessCodeTextInput";
|
|
45
|
+
return AccessCodeTextInput;
|
|
46
|
+
}(Component);
|
|
47
|
+
export default AccessCodeTextInput;
|
|
@@ -14,9 +14,8 @@ import { ProgressBar } from '@instructure/ui-progress';
|
|
|
14
14
|
import { Heading } from '@instructure/ui-heading';
|
|
15
15
|
import { Tabs } from '@instructure/ui-tabs';
|
|
16
16
|
import { ToggleDetails } from '@instructure/ui-toggle-details';
|
|
17
|
-
import { TextInput } from '@instructure/ui-text-input';
|
|
18
17
|
import { jsx } from '@instructure/emotion';
|
|
19
|
-
import { ImportantModal, ModalHeader, ModalBody, ModalFooter, FILE_UPLOAD_SELECT, FILE_UPLOAD_IMPORTING, FILE_UPLOAD_SUCCESS, FILE_UPLOAD_FAILURE, FILE_UPLOAD_ERROR, XSMALL_SIDE_MARGIN, withStyleOverrides } from '@instructure/quiz-common';
|
|
18
|
+
import { ImportantModal, ModalHeader, ModalBody, ModalFooter, FILE_UPLOAD_SELECT, FILE_UPLOAD_IMPORTING, FILE_UPLOAD_SUCCESS, FILE_UPLOAD_FAILURE, FILE_UPLOAD_ERROR, TextInput, XSMALL_SIDE_MARGIN, withStyleOverrides } from '@instructure/quiz-common';
|
|
20
19
|
import generateStyle from "./styles.js";
|
|
21
20
|
import generateComponentTheme from "./theme.js";
|
|
22
21
|
import ImportFileSelector from "./ImportFileSelector/index.js";
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { MaskedTextInput } from "./index.js";
|
|
3
|
+
var props = {
|
|
4
|
+
renderLabel: 'Example of a masked text input',
|
|
5
|
+
checkboxLabel: 'Select to show the current value',
|
|
6
|
+
value: 'Is it secret? Is it safe?',
|
|
7
|
+
onMaskedChange: Function.prototype
|
|
8
|
+
};
|
|
9
|
+
export default {
|
|
10
|
+
title: MaskedTextInput.name
|
|
11
|
+
};
|
|
12
|
+
export var whenMasked = function whenMasked() {
|
|
13
|
+
return /*#__PURE__*/React.createElement(MaskedTextInput, props);
|
|
14
|
+
};
|
|
15
|
+
export var whenUnmasked = function whenUnmasked() {
|
|
16
|
+
return /*#__PURE__*/React.createElement(MaskedTextInput, Object.assign({}, props, {
|
|
17
|
+
masked: false
|
|
18
|
+
}));
|
|
19
|
+
};
|
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
import _objectSpread from "@babel/runtime/helpers/esm/objectSpread2";
|
|
2
|
+
import _classCallCheck from "@babel/runtime/helpers/esm/classCallCheck";
|
|
3
|
+
import _createClass from "@babel/runtime/helpers/esm/createClass";
|
|
4
|
+
import _inherits from "@babel/runtime/helpers/esm/inherits";
|
|
5
|
+
import _createSuper from "@babel/runtime/helpers/esm/createSuper";
|
|
6
|
+
import React, { Component } from 'react';
|
|
7
|
+
import PropTypes from 'prop-types';
|
|
8
|
+
import { View } from '@instructure/ui-view';
|
|
9
|
+
import { Checkbox } from '@instructure/ui-checkbox';
|
|
10
|
+
import { omitProps } from '@instructure/ui-react-utils';
|
|
11
|
+
import { TextInput } from '@instructure/quiz-common';
|
|
12
|
+
var maskedTextInputPropTypes = {
|
|
13
|
+
/**
|
|
14
|
+
* The label to be used for the checkbox that controls whether the input is masked
|
|
15
|
+
*/
|
|
16
|
+
checkboxLabel: PropTypes.string.isRequired,
|
|
17
|
+
/**
|
|
18
|
+
* Whether or not the input text is masked
|
|
19
|
+
*/
|
|
20
|
+
masked: PropTypes.bool,
|
|
21
|
+
/**
|
|
22
|
+
* The function to call when the user clicks the checkbox to either mask or unmask the input
|
|
23
|
+
*/
|
|
24
|
+
onMaskedChange: PropTypes.func
|
|
25
|
+
};
|
|
26
|
+
export var MaskedTextInput = /*#__PURE__*/function (_Component) {
|
|
27
|
+
_inherits(MaskedTextInput, _Component);
|
|
28
|
+
var _super = _createSuper(MaskedTextInput);
|
|
29
|
+
function MaskedTextInput() {
|
|
30
|
+
_classCallCheck(this, MaskedTextInput);
|
|
31
|
+
return _super.apply(this, arguments);
|
|
32
|
+
}
|
|
33
|
+
_createClass(MaskedTextInput, [{
|
|
34
|
+
key: "render",
|
|
35
|
+
value: function render() {
|
|
36
|
+
var _this$props = this.props,
|
|
37
|
+
checkboxLabel = _this$props.checkboxLabel,
|
|
38
|
+
masked = _this$props.masked,
|
|
39
|
+
onMaskedChange = _this$props.onMaskedChange,
|
|
40
|
+
type = _this$props.type;
|
|
41
|
+
var textInputProps = _objectSpread(_objectSpread({}, omitProps(this.props, maskedTextInputPropTypes)), {}, {
|
|
42
|
+
type: masked ? 'password' : type
|
|
43
|
+
});
|
|
44
|
+
return /*#__PURE__*/React.createElement(View, {
|
|
45
|
+
as: "div"
|
|
46
|
+
}, /*#__PURE__*/React.createElement(TextInput, textInputProps), /*#__PURE__*/React.createElement(View, {
|
|
47
|
+
as: "div",
|
|
48
|
+
margin: "small 0"
|
|
49
|
+
}, /*#__PURE__*/React.createElement(Checkbox, {
|
|
50
|
+
label: checkboxLabel,
|
|
51
|
+
checked: !masked,
|
|
52
|
+
onChange: onMaskedChange
|
|
53
|
+
})));
|
|
54
|
+
}
|
|
55
|
+
}]);
|
|
56
|
+
MaskedTextInput.displayName = "MaskedTextInput";
|
|
57
|
+
return MaskedTextInput;
|
|
58
|
+
}(Component);
|
|
59
|
+
MaskedTextInput.propTypes = _objectSpread(_objectSpread({}, maskedTextInputPropTypes), TextInput.propTypes);
|
|
60
|
+
MaskedTextInput.defaultProps = _objectSpread(_objectSpread({}, TextInput.defaultProps), {}, {
|
|
61
|
+
masked: true,
|
|
62
|
+
onMaskedChange: Function.prototype
|
|
63
|
+
});
|
|
64
|
+
export default MaskedTextInput;
|
|
@@ -19,12 +19,15 @@ var generateStyle = function generateStyle(componentTheme, props) {
|
|
|
19
19
|
transition: componentTheme.contentTransition,
|
|
20
20
|
width: '100%',
|
|
21
21
|
'.user_content p': {
|
|
22
|
-
margin: componentTheme.userContentMargin,
|
|
22
|
+
margin: "".concat(componentTheme.userContentMargin, " 0"),
|
|
23
23
|
'&:first-of-type': {
|
|
24
|
-
|
|
24
|
+
margin: "0 0 ".concat(componentTheme.userContentMargin)
|
|
25
25
|
},
|
|
26
|
-
'&:last-
|
|
27
|
-
|
|
26
|
+
'&:last-of-type': {
|
|
27
|
+
margin: "".concat(componentTheme.userContentMargin, " 0 0")
|
|
28
|
+
},
|
|
29
|
+
'&:only-child': {
|
|
30
|
+
margin: 0
|
|
28
31
|
}
|
|
29
32
|
}
|
|
30
33
|
})
|
|
@@ -6,8 +6,7 @@ var generateComponentTheme = function generateComponentTheme(_ref) {
|
|
|
6
6
|
return {
|
|
7
7
|
fontFamily: typography.fontFamily,
|
|
8
8
|
contentTransition: "transform ".concat(transitions.duration),
|
|
9
|
-
userContentMargin: spacing.mediumSmall
|
|
10
|
-
userContentZeroMargin: 0
|
|
9
|
+
userContentMargin: spacing.mediumSmall
|
|
11
10
|
};
|
|
12
11
|
};
|
|
13
12
|
export default generateComponentTheme;
|
|
@@ -22,8 +22,8 @@ var CalculatorButton = function CalculatorButton(_ref) {
|
|
|
22
22
|
variant: "icon",
|
|
23
23
|
renderIcon: _ref2,
|
|
24
24
|
disabled: !enabled,
|
|
25
|
-
tooltip: t('
|
|
26
|
-
}, t('Calculator'));
|
|
25
|
+
tooltip: t('This calculator has accessibility limitations.')
|
|
26
|
+
}, t('Calculator'), /*#__PURE__*/React.createElement(ScreenReaderContent, null, t('Use the arrow keys to move the calculator after selecting "Move". Screen readers may not announce the launch clearly.')));
|
|
27
27
|
}
|
|
28
28
|
return /*#__PURE__*/React.createElement(Button, {
|
|
29
29
|
renderIcon: IconCalculatorLine,
|
|
@@ -1,10 +1,9 @@
|
|
|
1
|
+
import _objectSpread from "@babel/runtime/helpers/esm/objectSpread2";
|
|
2
|
+
import { generateExternalStyle } from "./externalStyles.js";
|
|
1
3
|
var generateStyle = function generateStyle(componentTheme) {
|
|
2
|
-
return {
|
|
3
|
-
showBrandIcon: true,
|
|
4
|
-
desktopBottomBorder: true,
|
|
5
|
-
desktopBottomBorderInverse: true,
|
|
4
|
+
return _objectSpread({
|
|
6
5
|
backgroundColor: componentTheme.backgroundColor,
|
|
7
6
|
phoneBreakPoint: componentTheme.phoneBreakPoint
|
|
8
|
-
};
|
|
7
|
+
}, generateExternalStyle());
|
|
9
8
|
};
|
|
10
9
|
export default generateStyle;
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
export var generateExternalStyle = function generateExternalStyle(componentTheme) {
|
|
2
|
+
return {
|
|
3
|
+
sidebar: {
|
|
4
|
+
borderTop: "".concat(componentTheme.sidebarBorderWidth, " solid ").concat(componentTheme.sidebarBorderColor),
|
|
5
|
+
borderRight: "".concat(componentTheme.sidebarBorderWidth, " solid ").concat(componentTheme.sidebarBorderColor),
|
|
6
|
+
borderBottom: "".concat(componentTheme.sidebarBorderWidth, " solid ").concat(componentTheme.sidebarBorderColor),
|
|
7
|
+
borderLeft: "".concat(componentTheme.sidebarBorderWidth, " solid ").concat(componentTheme.sidebarBorderColor)
|
|
8
|
+
}
|
|
9
|
+
};
|
|
10
|
+
};
|
|
@@ -11,7 +11,7 @@ import PropTypes from 'prop-types';
|
|
|
11
11
|
import { List } from 'immutable';
|
|
12
12
|
import ImmutablePropTypes from 'react-immutable-proptypes';
|
|
13
13
|
import { IconMoveStartLine, IconMoveEndLine, IconPinSolid, IconQuizInstructionsLine, IconQuizTitleLine } from '@instructure/ui-icons';
|
|
14
|
-
import { AccessibleContent,
|
|
14
|
+
import { AccessibleContent, PresentationContent, ScreenReaderContent } from '@instructure/ui-a11y-content';
|
|
15
15
|
import { IconButton } from '@instructure/ui-buttons';
|
|
16
16
|
import { Link } from '@instructure/ui-link';
|
|
17
17
|
import { Text } from '@instructure/ui-text';
|
|
@@ -19,6 +19,7 @@ import { View } from '@instructure/ui-view';
|
|
|
19
19
|
import { jsx, Global } from '@instructure/emotion';
|
|
20
20
|
import { Heading } from '@instructure/ui-heading';
|
|
21
21
|
import t from '@instructure/quiz-i18n/es/format-message';
|
|
22
|
+
import { Tooltip } from '@instructure/ui-tooltip';
|
|
22
23
|
import { INSTRUCTIONS_SCROLL_KEY, RESULTS_SCROLL_KEY, SIDEBAR_NAV_ID, TITLE_SCROLL_KEY, END_EDITING_TRIGGER_CLASSNAME, withStyleOverrides } from '@instructure/quiz-common';
|
|
23
24
|
import { onPhone } from "../../../../util/windowChecks.js";
|
|
24
25
|
import CustomPropTypes from "../../../../util/CustomPropTypes.js";
|
|
@@ -101,12 +102,19 @@ export var Sidebar = (_dec = withStyleOverrides(generateStyle, generateComponent
|
|
|
101
102
|
}, {
|
|
102
103
|
key: "renderTitle",
|
|
103
104
|
value: function renderTitle() {
|
|
105
|
+
var navigationText = t('Navigate to title');
|
|
104
106
|
if (this.props.grading) {
|
|
105
107
|
return;
|
|
106
108
|
}
|
|
107
109
|
return jsx("div", {
|
|
108
110
|
css: this.props.styles.sidebar.actionableInfo,
|
|
109
111
|
className: END_EDITING_TRIGGER_CLASSNAME
|
|
112
|
+
}, jsx(Tooltip, {
|
|
113
|
+
renderTip: this.props.sidebarOpen ? '' : jsx("span", {
|
|
114
|
+
"aria-hidden": "true"
|
|
115
|
+
}, navigationText),
|
|
116
|
+
placement: "start",
|
|
117
|
+
on: this.props.sidebarOpen ? [] : ['focus', 'hover']
|
|
110
118
|
}, jsx(Link, {
|
|
111
119
|
href: "#",
|
|
112
120
|
margin: "small",
|
|
@@ -114,7 +122,7 @@ export var Sidebar = (_dec = withStyleOverrides(generateStyle, generateComponent
|
|
|
114
122
|
onClick: this.scrollToTitle,
|
|
115
123
|
renderIcon: _ref,
|
|
116
124
|
"data-automation": "sidebar-title-button"
|
|
117
|
-
}, jsx(ScreenReaderContent, null,
|
|
125
|
+
}, jsx(ScreenReaderContent, null, navigationText))), jsx(PresentationContent, null, jsx("span", {
|
|
118
126
|
css: this.props.styles.sidebar.description,
|
|
119
127
|
"data-automation": "sidebar-title-text",
|
|
120
128
|
onClick: this.scrollToTitle,
|
|
@@ -124,12 +132,19 @@ export var Sidebar = (_dec = withStyleOverrides(generateStyle, generateComponent
|
|
|
124
132
|
}, {
|
|
125
133
|
key: "renderInstructions",
|
|
126
134
|
value: function renderInstructions() {
|
|
135
|
+
var navigationText = t('Navigate to instructions');
|
|
127
136
|
if (this.props.grading) {
|
|
128
137
|
return;
|
|
129
138
|
}
|
|
130
139
|
return jsx("div", {
|
|
131
140
|
css: this.props.styles.sidebar.actionableInfo,
|
|
132
141
|
className: END_EDITING_TRIGGER_CLASSNAME
|
|
142
|
+
}, jsx(Tooltip, {
|
|
143
|
+
renderTip: this.props.sidebarOpen ? '' : jsx("span", {
|
|
144
|
+
"aria-hidden": "true"
|
|
145
|
+
}, navigationText),
|
|
146
|
+
placement: "start",
|
|
147
|
+
on: this.props.sidebarOpen ? [] : ['focus', 'hover']
|
|
133
148
|
}, jsx(Link, {
|
|
134
149
|
href: "#",
|
|
135
150
|
margin: "small",
|
|
@@ -137,7 +152,7 @@ export var Sidebar = (_dec = withStyleOverrides(generateStyle, generateComponent
|
|
|
137
152
|
onClick: this.scrollToInfo,
|
|
138
153
|
renderIcon: _ref2,
|
|
139
154
|
"data-automation": "sidebar-instructions-button"
|
|
140
|
-
}, jsx(ScreenReaderContent, null,
|
|
155
|
+
}, jsx(ScreenReaderContent, null, navigationText))), jsx(PresentationContent, null, jsx("span", {
|
|
141
156
|
css: this.props.styles.sidebar.description,
|
|
142
157
|
"data-automation": "sidebar-instructions-text",
|
|
143
158
|
onClick: this.scrollToInfo,
|
|
@@ -147,11 +162,18 @@ export var Sidebar = (_dec = withStyleOverrides(generateStyle, generateComponent
|
|
|
147
162
|
}, {
|
|
148
163
|
key: "renderResults",
|
|
149
164
|
value: function renderResults() {
|
|
165
|
+
var navigationText = t('Navigate to results');
|
|
150
166
|
if (!this.props.grading) {
|
|
151
167
|
return;
|
|
152
168
|
}
|
|
153
169
|
return jsx("div", {
|
|
154
170
|
css: this.props.styles.sidebar.actionableInfo
|
|
171
|
+
}, jsx(Tooltip, {
|
|
172
|
+
renderTip: this.props.sidebarOpen ? '' : jsx("span", {
|
|
173
|
+
"aria-hidden": "true"
|
|
174
|
+
}, navigationText),
|
|
175
|
+
placement: "start",
|
|
176
|
+
on: this.props.sidebarOpen ? [] : ['focus', 'hover']
|
|
155
177
|
}, jsx(Link, {
|
|
156
178
|
href: "#",
|
|
157
179
|
margin: "small",
|
|
@@ -159,7 +181,7 @@ export var Sidebar = (_dec = withStyleOverrides(generateStyle, generateComponent
|
|
|
159
181
|
onClick: this.scrollToResults,
|
|
160
182
|
renderIcon: _ref3,
|
|
161
183
|
"data-automation": "sidebar-results-button"
|
|
162
|
-
}, jsx(ScreenReaderContent, null,
|
|
184
|
+
}, jsx(ScreenReaderContent, null, navigationText))), jsx(PresentationContent, null, jsx("span", {
|
|
163
185
|
css: this.props.styles.sidebar.description,
|
|
164
186
|
"data-automation": "sidebar-results-text",
|
|
165
187
|
onClick: this.scrollToResults,
|
|
@@ -1,18 +1,16 @@
|
|
|
1
1
|
import _defineProperty from "@babel/runtime/helpers/esm/defineProperty";
|
|
2
2
|
import _objectSpread from "@babel/runtime/helpers/esm/objectSpread2";
|
|
3
|
+
import merge from 'lodash/merge';
|
|
4
|
+
import { generateExternalStyle } from "./externalStyles.js";
|
|
3
5
|
var generateStyle = function generateStyle(componentTheme, props) {
|
|
4
6
|
var _commonContainer;
|
|
5
7
|
var mq = "@media screen and (".concat(componentTheme.phoneBreakPoint, ")");
|
|
6
8
|
var mp = '@media print';
|
|
7
|
-
return {
|
|
9
|
+
return merge({
|
|
8
10
|
sidebar: _objectSpread(_objectSpread(_defineProperty({
|
|
9
11
|
boxSizing: 'border-box',
|
|
10
12
|
width: componentTheme.sidebarWidthClosed,
|
|
11
13
|
backgroundColor: componentTheme.sidebarBackgroundColor,
|
|
12
|
-
borderTop: "".concat(componentTheme.sidebarBorderWidth, " solid ").concat(componentTheme.sidebarBorderColor),
|
|
13
|
-
borderRight: "".concat(componentTheme.sidebarBorderWidth, " solid ").concat(componentTheme.sidebarBorderColor),
|
|
14
|
-
borderBottom: "".concat(componentTheme.sidebarBorderWidth, " solid ").concat(componentTheme.sidebarBorderColor),
|
|
15
|
-
borderLeft: "".concat(componentTheme.sidebarBorderWidth, " solid ").concat(componentTheme.sidebarBorderColor),
|
|
16
14
|
color: componentTheme.sidebarColor,
|
|
17
15
|
height: '100%',
|
|
18
16
|
overflow: 'hidden',
|
|
@@ -111,6 +109,6 @@ var generateStyle = function generateStyle(componentTheme, props) {
|
|
|
111
109
|
}), _defineProperty(_commonContainer, mp, {
|
|
112
110
|
display: 'none'
|
|
113
111
|
}), _commonContainer)
|
|
114
|
-
};
|
|
112
|
+
}, generateExternalStyle(componentTheme));
|
|
115
113
|
};
|
|
116
114
|
export default generateStyle;
|
|
@@ -7,16 +7,16 @@ var _dec, _class, _SidebarItem;
|
|
|
7
7
|
import { Component } from 'react';
|
|
8
8
|
import PropTypes from 'prop-types';
|
|
9
9
|
import ImmutablePropTypes from 'react-immutable-proptypes';
|
|
10
|
-
import { AccessibleContent } from '@instructure/ui-a11y-content';
|
|
11
10
|
import { Link } from '@instructure/ui-link';
|
|
12
|
-
import { Flex } from '@instructure/ui-flex';
|
|
13
11
|
import { jsx } from '@instructure/emotion';
|
|
14
12
|
import PositionSummary from "../PositionSummary/index.js";
|
|
15
13
|
import t from '@instructure/quiz-i18n/es/format-message';
|
|
16
14
|
import { RichContentRenderer } from '@instructure/quiz-rce';
|
|
17
15
|
import generateStyle from "./styles.js";
|
|
18
16
|
import generateComponentTheme from "./theme.js";
|
|
19
|
-
import { END_EDITING_TRIGGER_CLASSNAME, withStyleOverrides } from '@instructure/quiz-common';
|
|
17
|
+
import { Flex, END_EDITING_TRIGGER_CLASSNAME, withStyleOverrides } from '@instructure/quiz-common';
|
|
18
|
+
import { Tooltip } from '@instructure/ui-tooltip';
|
|
19
|
+
import { AccessibleContent } from '@instructure/ui-a11y-content';
|
|
20
20
|
export var SidebarItem = (_dec = withStyleOverrides(generateStyle, generateComponentTheme), _dec(_class = (_SidebarItem = /*#__PURE__*/function (_Component) {
|
|
21
21
|
_inherits(SidebarItem, _Component);
|
|
22
22
|
var _super = _createSuper(SidebarItem);
|
|
@@ -89,12 +89,18 @@ export var SidebarItem = (_dec = withStyleOverrides(generateStyle, generateCompo
|
|
|
89
89
|
displayPosition = _this$props2.displayPosition,
|
|
90
90
|
itemId = _this$props2.itemId,
|
|
91
91
|
isAnswered = _this$props2.isAnswered;
|
|
92
|
-
var
|
|
92
|
+
var content = !isAnswered && isAnswered !== null ? t('Navigate to question at position {displayPosition}, unanswered', {
|
|
93
93
|
displayPosition: displayPosition
|
|
94
94
|
}) : t('Navigate to question at position {displayPosition}', {
|
|
95
95
|
displayPosition: displayPosition
|
|
96
96
|
});
|
|
97
|
-
return jsx(
|
|
97
|
+
return jsx(Tooltip, {
|
|
98
|
+
renderTip: this.props.sidebarOpen ? '' : jsx("span", {
|
|
99
|
+
"aria-hidden": "true"
|
|
100
|
+
}, content),
|
|
101
|
+
placement: "start",
|
|
102
|
+
on: this.props.sidebarOpen ? [] : ['hover', 'focus']
|
|
103
|
+
}, jsx(Link, {
|
|
98
104
|
href: "#",
|
|
99
105
|
size: "small",
|
|
100
106
|
margin: "0 small",
|
|
@@ -104,8 +110,8 @@ export var SidebarItem = (_dec = withStyleOverrides(generateStyle, generateCompo
|
|
|
104
110
|
"data-automation-item-id": itemId,
|
|
105
111
|
"data-automation": "sdk-sidebar-item-button"
|
|
106
112
|
}, jsx(AccessibleContent, {
|
|
107
|
-
alt:
|
|
108
|
-
}, this.renderPosition()));
|
|
113
|
+
alt: content
|
|
114
|
+
}, this.renderPosition())));
|
|
109
115
|
}
|
|
110
116
|
}, {
|
|
111
117
|
key: "renderClosed",
|