@pocketprep/ui-kit 3.4.55 → 3.4.57

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.
@@ -45,7 +45,7 @@ import { dark } from '../../directives'
45
45
 
46
46
  type TButtonType = 'primary' | 'primary-yellow' | 'primary-red' | 'secondary'
47
47
  | 'secondary-yellow-dark' | 'tertiary' | 'tertiary-red' | 'tertiary-small' | 'tertiary-red-small' | 'icon'
48
- | 'icon-yellow'
48
+ | 'icon-yellow' | 'outline'
49
49
 
50
50
  @Component({
51
51
  components: {
@@ -115,6 +115,7 @@ export default class Button extends Vue {
115
115
  &--primary,
116
116
  &--primary-yellow,
117
117
  &--primary-red,
118
+ &--outline,
118
119
  &--secondary,
119
120
  &--secondary-yellow-dark {
120
121
  font-size: 15px;
@@ -142,7 +143,7 @@ export default class Button extends Vue {
142
143
  }
143
144
 
144
145
  &--dark:enabled:focus::before {
145
- border-color: $butterscotch;
146
+ border-color: $banana-bread;
146
147
  }
147
148
  }
148
149
 
@@ -233,6 +234,48 @@ export default class Button extends Vue {
233
234
  }
234
235
  }
235
236
 
237
+ &--outline {
238
+ background-color: $white;
239
+ color: $brand-blue;
240
+ font-size: 15px;
241
+ font-weight: 600;
242
+ border: 1px solid $brand-blue;
243
+
244
+ &:enabled {
245
+ &:hover,
246
+ &:active {
247
+ background-color: $pearl;
248
+ }
249
+
250
+ &:focus::before {
251
+ content: '';
252
+ position: absolute;
253
+ top: -3px;
254
+ bottom: -3px;
255
+ left: -3px;
256
+ right: -3px;
257
+ border-radius: 6px;
258
+ }
259
+ }
260
+
261
+ &:disabled {
262
+ opacity: 0.4;
263
+ }
264
+
265
+ &--dark {
266
+ background-color: $charcoal;
267
+ color: $banana-bread;
268
+ border-color: $banana-bread;
269
+
270
+ &:enabled {
271
+ &:hover,
272
+ &:active {
273
+ background-color: $mariner;
274
+ }
275
+ }
276
+ }
277
+ }
278
+
236
279
  &--secondary {
237
280
  background-color: transparent;
238
281
  color: $brand-blue;
@@ -43,6 +43,7 @@
43
43
  >
44
44
  <slot name="radioItem" :item="item">
45
45
  <RadioButton
46
+ class="uikit-radio__item-btn"
46
47
  :selected="!!(modelValue && item.value === modelValue.value)"
47
48
  :disabled="!!(disabled || item.disabled)"
48
49
  :isDarkMode="isDarkMode"
@@ -248,66 +249,8 @@ export default class Radio extends Vue {
248
249
  }
249
250
 
250
251
  &__item-btn {
251
- width: 18px;
252
- height: 18px;
252
+ min-width: 18px;
253
253
  margin-right: 12px;
254
- border: 1px solid $steel;
255
- background: $white;
256
- border-radius: 18px;
257
- position: relative;
258
- box-sizing: border-box;
259
-
260
- &::before {
261
- content: '';
262
- position: absolute;
263
- left: 50%;
264
- top: 50%;
265
- transform: translate(-50%, -50%);
266
- width: 12px;
267
- height: 12px;
268
- border-radius: 12px;
269
- background: $brand-blue;
270
- display: none;
271
- }
272
-
273
- &--dark {
274
- background-color: transparent;
275
- border-color: $pewter;
276
-
277
- &::before {
278
- background: $banana-bread;
279
- }
280
- }
281
-
282
- &--disabled {
283
- background-color: $fog;
284
- opacity: 0.6;
285
- border-color: rgba($steel, 0.6);
286
-
287
- &--dark {
288
- background-color: $moonlit-ocean;
289
- border-color: $slate;
290
- opacity: 1;
291
- }
292
- }
293
-
294
- &--selected {
295
- border-color: $brand-blue;
296
- background: transparent;
297
-
298
- &--dark {
299
- border-color: $banana-bread;
300
- }
301
-
302
- &--disabled {
303
- opacity: 0.4;
304
-
305
- }
306
-
307
- &::before {
308
- display: block;
309
- }
310
- }
311
254
  }
312
255
  }
313
256
  </style>
@@ -171,7 +171,10 @@
171
171
  @click="handleClick"
172
172
  >
173
173
  <template #explanationTopExperiment>
174
- <slot name="explanationTopExperiment"></slot>
174
+ <slot name="explanationTopExperiment" />
175
+ </template>
176
+ <template #explanationBottomExperiment>
177
+ <slot name="explanationBottomExperiment" />
175
178
  </template>
176
179
  </DropdownExplanation>
177
180
  </div>
@@ -65,6 +65,7 @@
65
65
  <span class="uikit-question-dropdown-explanation__dropdown-reference-label">Reference: </span>
66
66
  <div v-html="reference" />
67
67
  </div>
68
+ <slot name="explanationBottomExperiment" />
68
69
  </div>
69
70
  </template>
70
71
 
@@ -13,7 +13,7 @@
13
13
  >
14
14
  Explanation Details
15
15
  </div>
16
- <slot name="explanationTopExperiment"></slot>
16
+ <slot name="explanationTopExperiment" />
17
17
  <div
18
18
  v-dark="isDarkMode"
19
19
  v-breakpoint:questionEl="breakpoints"
@@ -70,6 +70,7 @@
70
70
  <span class="uikit-question-explanation__reference-label">Reference: </span>
71
71
  <div v-html="reference" />
72
72
  </div>
73
+ <slot name="explanationBottomExperiment" />
73
74
  <div
74
75
  v-if="!reviewMode"
75
76
  v-dark="isDarkMode"
@@ -96,6 +96,7 @@
96
96
  <span class="uikit-question-summary__summary-dropdown-reference-label">Reference: </span>
97
97
  <div v-html="reference" />
98
98
  </div>
99
+ <slot name="explanationBottomExperiment" />
99
100
  </div>
100
101
  <Icon
101
102
  v-if="isQuestionCorrect"
@@ -57,6 +57,17 @@
57
57
  </template>
58
58
  </QuestionContext>
59
59
  </slot>
60
+ <div
61
+ v-if="questionScenario && currentScenarioQuestionNumber && numberOfScenarioQuestions"
62
+ v-dark="isDarkMode"
63
+ v-breakpoint:questionEl="breakpoints"
64
+ tabindex="-1"
65
+ class="uikit-question__scenario-part-x-of-y-label"
66
+ :aria-label="`Scenario Part ${currentScenarioQuestionNumber} of ${numberOfScenarioQuestions}`"
67
+ aria-live="assertive"
68
+ >
69
+ Part {{ currentScenarioQuestionNumber }} of {{ numberOfScenarioQuestions }}
70
+ </div>
60
71
  <slot name="promptExperiment" />
61
72
  <div
62
73
  ref="prompt"
@@ -219,6 +230,9 @@
219
230
  :choiceKey="choiceKey"
220
231
  />
221
232
  </template>
233
+ <template #explanationBottomExperiment>
234
+ <slot name="explanationBottomExperiment" />
235
+ </template>
222
236
  </ChoicesContainer>
223
237
  <MatrixChoicesContainer
224
238
  v-if="question.type === 'Matrix Checkbox' || question.type === 'Matrix Radio Button'"
@@ -328,6 +342,9 @@
328
342
  <template #explanationTopExperiment>
329
343
  <slot name="explanationTopExperiment"></slot>
330
344
  </template>
345
+ <template #explanationBottomExperiment>
346
+ <slot name="explanationBottomExperiment" />
347
+ </template>
331
348
  </Summary>
332
349
  <slot name="metricsTiles">
333
350
  <StatsSummary
@@ -458,6 +475,9 @@
458
475
  <template #explanationTopExperiment>
459
476
  <slot name="explanationTopExperiment"></slot>
460
477
  </template>
478
+ <template #explanationBottomExperiment>
479
+ <slot name="explanationBottomExperiment" />
480
+ </template>
461
481
  </Explanation>
462
482
  </div>
463
483
  </div>
@@ -495,6 +515,7 @@ import type {
495
515
  TMatrixChoiceScores,
496
516
  TNamesRow,
497
517
  TViewNames,
518
+ IScenarioSerial,
498
519
  } from './question'
499
520
 
500
521
  @Component({
@@ -615,6 +636,29 @@ export default class Question extends Vue {
615
636
  return this.question.type === 'Matrix Checkbox' || this.question.type === 'Matrix Radio Button'
616
637
  }
617
638
 
639
+ get questionScenario () {
640
+ return this.question.questionScenario as Study.Class.QuestionScenarioJSON | undefined
641
+ }
642
+
643
+ get numberOfScenarioQuestions () {
644
+ return this.questionScenario?.questions.length
645
+ }
646
+
647
+ get currentScenarioQuestionNumber () {
648
+ if (this.questionScenario?.questions) {
649
+ const indexOfScenarioSerial = this.questionScenario.questions.findIndex(
650
+ (scenarioSerial: IScenarioSerial) => {
651
+ return scenarioSerial.serial === this.question.serial
652
+ }
653
+ )
654
+
655
+ return indexOfScenarioSerial !== -1 ? indexOfScenarioSerial + 1 : undefined
656
+ }
657
+
658
+ return undefined
659
+
660
+ }
661
+
618
662
  get passageImageUrl () {
619
663
  const imageUrl = this.question.passageImage?.url
620
664
 
@@ -1639,6 +1683,27 @@ export default class Question extends Vue {
1639
1683
  }
1640
1684
  }
1641
1685
 
1686
+ &__scenario-part-x-of-y-label {
1687
+ padding: 0 16px;
1688
+ margin-bottom: 4px;
1689
+ width: 100%;
1690
+ max-width: 490px;
1691
+ box-sizing: border-box;
1692
+ font-size: 14px;
1693
+ font-weight: 500;
1694
+ line-height: 19px;
1695
+ color: $slate;
1696
+
1697
+ &--dark {
1698
+ color: $fog;
1699
+ }
1700
+
1701
+ &--mobile {
1702
+ line-height: 20px;
1703
+ margin-bottom: 8px;
1704
+ }
1705
+ }
1706
+
1642
1707
  &__prompt {
1643
1708
  outline: none;
1644
1709
  font-weight: 600;
@@ -50,4 +50,8 @@ export interface IRadioOptions {
50
50
  choices: TMatrixChoiceKey[]
51
51
  value: TMatrixChoiceKey | null
52
52
  label?: string
53
+ }
54
+
55
+ export interface IScenarioSerial {
56
+ serial: string
53
57
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@pocketprep/ui-kit",
3
- "version": "3.4.55",
3
+ "version": "3.4.57",
4
4
  "description": "Pocket Prep UI Kit",
5
5
  "author": "pocketprep",
6
6
  "scripts": {
@@ -78,7 +78,7 @@
78
78
  "vue-router": "4.2.5"
79
79
  },
80
80
  "devDependencies": {
81
- "@pocketprep/types": "1.14.10",
81
+ "@pocketprep/types": "1.14.20",
82
82
  "@tsconfig/node16": "1.0.3",
83
83
  "@types/node": "16.18.25",
84
84
  "@vitejs/plugin-vue": "4.6.2",