@pocketprep/ui-kit 3.4.52 → 3.4.54
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/dist/@pocketprep/ui-kit.js +12357 -11200
- package/dist/@pocketprep/ui-kit.js.map +1 -1
- package/dist/@pocketprep/ui-kit.umd.cjs +10 -10
- package/dist/@pocketprep/ui-kit.umd.cjs.map +1 -1
- package/dist/style.css +1 -1
- package/lib/components/Forms/Checkbox.vue +9 -1
- package/lib/components/Forms/Radio.vue +11 -11
- package/lib/components/Forms/RadioButton.vue +140 -0
- package/lib/components/Quiz/Question/ChoicesContainer.vue +5 -1
- package/lib/components/Quiz/Question/DropdownExplanation.vue +8 -1
- package/lib/components/Quiz/Question/Explanation.vue +7 -0
- package/lib/components/Quiz/Question/MatrixChoicesContainer.vue +614 -0
- package/lib/components/Quiz/Question/MatrixRadioGroup.vue +98 -0
- package/lib/components/Quiz/Question/MobileMatrixChoicesContainer.vue +710 -0
- package/lib/components/Quiz/Question/MobileMatrixRadioGroup.vue +131 -0
- package/lib/components/Quiz/Question/StatsSummary.vue +11 -3
- package/lib/components/Quiz/Question/Summary.vue +28 -3
- package/lib/components/Quiz/Question.vue +293 -28
- package/lib/components/Quiz/question.d.ts +12 -0
- package/lib/utils.ts +2 -1
- package/package.json +2 -2
|
@@ -7,8 +7,9 @@
|
|
|
7
7
|
'uikit-checkbox--disabled': disabled,
|
|
8
8
|
'uikit-checkbox--checked': modelValue === true,
|
|
9
9
|
'uikit-checkbox--checked--disabled': disabled && modelValue === true,
|
|
10
|
-
'uikit-checkbox--indeterminate': modelValue === null
|
|
10
|
+
'uikit-checkbox--indeterminate': modelValue === null,
|
|
11
11
|
}"
|
|
12
|
+
:style="checkboxStyles"
|
|
12
13
|
:tabindex="disabled ? -1 : 0"
|
|
13
14
|
:aria-checked="modelValue === true ? true : modelValue === null ? 'mixed' : false"
|
|
14
15
|
role="checkbox"
|
|
@@ -25,6 +26,7 @@
|
|
|
25
26
|
v-dark="isDarkMode"
|
|
26
27
|
type="check"
|
|
27
28
|
class="uikit-checkbox__check"
|
|
29
|
+
:style="checkboxCheckStyles"
|
|
28
30
|
/>
|
|
29
31
|
<div
|
|
30
32
|
v-if="modelValue === null"
|
|
@@ -54,6 +56,12 @@ export default class Checkbox extends Vue {
|
|
|
54
56
|
@Prop({ default: false }) isDarkMode!: boolean
|
|
55
57
|
@Prop({ default: false }) hasLabel!: boolean
|
|
56
58
|
|
|
59
|
+
/******* Element-specific style props *******/
|
|
60
|
+
// .uikit-checkbox
|
|
61
|
+
@Prop() checkboxStyles!: Record<string, string>
|
|
62
|
+
// .uikit-checkbox__check
|
|
63
|
+
@Prop() checkboxCheckStyles!: Record<string, string>
|
|
64
|
+
|
|
57
65
|
hover = false
|
|
58
66
|
focus = false
|
|
59
67
|
|
|
@@ -37,21 +37,16 @@
|
|
|
37
37
|
role="radio"
|
|
38
38
|
:aria-checked="modelValue && item.value === modelValue.value"
|
|
39
39
|
:aria-label="`${item.label}${ item.helperText ? ` ${item.helperText}` : '' }`"
|
|
40
|
-
@click="!(disabled || item.disabled) && selectItem(item)"
|
|
40
|
+
@click="!(disabled || item.disabled ) && selectItem(item)"
|
|
41
41
|
@keydown.enter.space="keyPressedItem"
|
|
42
42
|
@mousedown.prevent
|
|
43
43
|
>
|
|
44
44
|
<slot name="radioItem" :item="item">
|
|
45
|
-
<
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
:
|
|
49
|
-
|
|
50
|
-
'uikit-radio__item-btn--disabled': disabled || item.disabled,
|
|
51
|
-
'uikit-radio__item-btn--selected--disabled': (disabled || item.disabled) && modelValue
|
|
52
|
-
&& item.value === modelValue.value,
|
|
53
|
-
}"
|
|
54
|
-
aria-hidden="true"
|
|
45
|
+
<RadioButton
|
|
46
|
+
:selected="!!(modelValue && item.value === modelValue.value)"
|
|
47
|
+
:disabled="!!(disabled || item.disabled)"
|
|
48
|
+
:isDarkMode="isDarkMode"
|
|
49
|
+
color="blue"
|
|
55
50
|
/>
|
|
56
51
|
<div class="uikit-radio__item-text" aria-hidden="true">
|
|
57
52
|
<slot name="radioItemLabel" :item="item">
|
|
@@ -73,6 +68,7 @@
|
|
|
73
68
|
<script lang="ts">
|
|
74
69
|
import { Component, Vue, Prop, Emit } from 'vue-facing-decorator'
|
|
75
70
|
import { dark } from '../../directives'
|
|
71
|
+
import RadioButton from './RadioButton.vue'
|
|
76
72
|
|
|
77
73
|
interface IItem {
|
|
78
74
|
value: string
|
|
@@ -82,6 +78,9 @@ interface IItem {
|
|
|
82
78
|
}
|
|
83
79
|
|
|
84
80
|
@Component({
|
|
81
|
+
components: {
|
|
82
|
+
RadioButton,
|
|
83
|
+
},
|
|
85
84
|
directives: {
|
|
86
85
|
dark,
|
|
87
86
|
},
|
|
@@ -302,6 +301,7 @@ export default class Radio extends Vue {
|
|
|
302
301
|
|
|
303
302
|
&--disabled {
|
|
304
303
|
opacity: 0.4;
|
|
304
|
+
|
|
305
305
|
}
|
|
306
306
|
|
|
307
307
|
&::before {
|
|
@@ -0,0 +1,140 @@
|
|
|
1
|
+
<script setup lang="ts">
|
|
2
|
+
import { dark as vDark } from '../../directives'
|
|
3
|
+
|
|
4
|
+
defineProps<{
|
|
5
|
+
selected: boolean
|
|
6
|
+
disabled: boolean
|
|
7
|
+
isDarkMode: boolean
|
|
8
|
+
color: 'blue' | 'green' | 'gray'
|
|
9
|
+
}>()
|
|
10
|
+
</script>
|
|
11
|
+
|
|
12
|
+
<template>
|
|
13
|
+
<div
|
|
14
|
+
v-dark="isDarkMode"
|
|
15
|
+
class="uikit-radio-btn"
|
|
16
|
+
:class="{
|
|
17
|
+
'uikit-radio-btn--selected': selected,
|
|
18
|
+
'uikit-radio-btn--disabled': disabled,
|
|
19
|
+
[`uikit-radio-btn--${color}`]: true,
|
|
20
|
+
}"
|
|
21
|
+
aria-hidden="true"
|
|
22
|
+
/>
|
|
23
|
+
</template>
|
|
24
|
+
|
|
25
|
+
<style lang="scss" scoped>
|
|
26
|
+
@import '../../styles/colors';
|
|
27
|
+
|
|
28
|
+
.uikit-radio-btn {
|
|
29
|
+
width: 18px;
|
|
30
|
+
height: 18px;
|
|
31
|
+
border: 1px solid $steel;
|
|
32
|
+
background: $white;
|
|
33
|
+
border-radius: 18px;
|
|
34
|
+
position: relative;
|
|
35
|
+
box-sizing: border-box;
|
|
36
|
+
|
|
37
|
+
&::before {
|
|
38
|
+
content: '';
|
|
39
|
+
position: absolute;
|
|
40
|
+
left: 50%;
|
|
41
|
+
top: 50%;
|
|
42
|
+
transform: translate(-50%, -50%);
|
|
43
|
+
width: 12px;
|
|
44
|
+
height: 12px;
|
|
45
|
+
border-radius: 12px;
|
|
46
|
+
background: $brand-blue;
|
|
47
|
+
display: none;
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
&--dark {
|
|
51
|
+
background-color: transparent;
|
|
52
|
+
border-color: $pewter;
|
|
53
|
+
|
|
54
|
+
&::before {
|
|
55
|
+
background: $banana-bread;
|
|
56
|
+
}
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
&--disabled {
|
|
60
|
+
background-color: $fog;
|
|
61
|
+
opacity: 0.6;
|
|
62
|
+
border-color: rgba($steel, 0.6);
|
|
63
|
+
|
|
64
|
+
&--dark {
|
|
65
|
+
background-color: $moonlit-ocean;
|
|
66
|
+
border-color: $slate;
|
|
67
|
+
opacity: 1;
|
|
68
|
+
}
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
&--selected {
|
|
72
|
+
border-color: $brand-blue;
|
|
73
|
+
background: transparent;
|
|
74
|
+
|
|
75
|
+
&--dark {
|
|
76
|
+
border-color: $banana-bread;
|
|
77
|
+
}
|
|
78
|
+
|
|
79
|
+
&::before {
|
|
80
|
+
display: block;
|
|
81
|
+
}
|
|
82
|
+
}
|
|
83
|
+
|
|
84
|
+
&--selected#{&}--disabled {
|
|
85
|
+
opacity: 0.4;
|
|
86
|
+
}
|
|
87
|
+
|
|
88
|
+
&--selected#{&}--green {
|
|
89
|
+
border-color: $cadaverous;
|
|
90
|
+
&::before {
|
|
91
|
+
background: $cadaverous;
|
|
92
|
+
}
|
|
93
|
+
&--dark {
|
|
94
|
+
border-color: $jungle-green;
|
|
95
|
+
&::before {
|
|
96
|
+
background: $jungle-green;
|
|
97
|
+
}
|
|
98
|
+
}
|
|
99
|
+
}
|
|
100
|
+
|
|
101
|
+
&--selected#{&}--gray {
|
|
102
|
+
&::before {
|
|
103
|
+
background: $slate;
|
|
104
|
+
}
|
|
105
|
+
&--dark {
|
|
106
|
+
&::before {
|
|
107
|
+
background: $pewter;
|
|
108
|
+
}
|
|
109
|
+
}
|
|
110
|
+
}
|
|
111
|
+
|
|
112
|
+
&--green {
|
|
113
|
+
&::before {
|
|
114
|
+
background: $jungle-green;
|
|
115
|
+
}
|
|
116
|
+
|
|
117
|
+
&--dark {
|
|
118
|
+
&::before {
|
|
119
|
+
background: $jungle-green;
|
|
120
|
+
}
|
|
121
|
+
}
|
|
122
|
+
}
|
|
123
|
+
|
|
124
|
+
&--gray {
|
|
125
|
+
border-color: $slate;
|
|
126
|
+
|
|
127
|
+
&::before {
|
|
128
|
+
background: $slate;
|
|
129
|
+
}
|
|
130
|
+
|
|
131
|
+
&--dark {
|
|
132
|
+
border-color: $pewter;
|
|
133
|
+
|
|
134
|
+
&::before {
|
|
135
|
+
background: $pewter;
|
|
136
|
+
}
|
|
137
|
+
}
|
|
138
|
+
}
|
|
139
|
+
}
|
|
140
|
+
</style>
|
|
@@ -169,7 +169,11 @@
|
|
|
169
169
|
:keyword-definitions="keywordDefinitions"
|
|
170
170
|
@toggleDropdownExplanationImageLongAlt="toggleDropdownExplanationImageLongAlt"
|
|
171
171
|
@click="handleClick"
|
|
172
|
-
|
|
172
|
+
>
|
|
173
|
+
<template #explanationTopExperiment>
|
|
174
|
+
<slot name="explanationTopExperiment"></slot>
|
|
175
|
+
</template>
|
|
176
|
+
</DropdownExplanation>
|
|
173
177
|
</div>
|
|
174
178
|
<template v-if="!globalMetrics">
|
|
175
179
|
<div
|
|
@@ -7,6 +7,7 @@
|
|
|
7
7
|
'uikit-question-dropdown-explanation__dropdown-explanation--show-stats': globalMetrics
|
|
8
8
|
}"
|
|
9
9
|
>
|
|
10
|
+
<slot name="explanationTopExperiment"></slot>
|
|
10
11
|
<div
|
|
11
12
|
v-dark="isDarkMode"
|
|
12
13
|
class="uikit-question-dropdown-explanation__dropdown-explanation-text"
|
|
@@ -113,7 +114,7 @@ export default class DropdownExplanation extends Vue {
|
|
|
113
114
|
text: this.question.explanation || '',
|
|
114
115
|
keywordDefinitions: this.keywordDefinitions,
|
|
115
116
|
isDarkMode: this.isDarkMode,
|
|
116
|
-
location: '
|
|
117
|
+
location: 'explanation',
|
|
117
118
|
})
|
|
118
119
|
}
|
|
119
120
|
|
|
@@ -174,6 +175,12 @@ export default class DropdownExplanation extends Vue {
|
|
|
174
175
|
line-height: 24px;
|
|
175
176
|
font-weight: 400;
|
|
176
177
|
padding-bottom: 6px;
|
|
178
|
+
|
|
179
|
+
.keyword-highlight {
|
|
180
|
+
span {
|
|
181
|
+
font-size: 16px;
|
|
182
|
+
}
|
|
183
|
+
}
|
|
177
184
|
|
|
178
185
|
p {
|
|
179
186
|
margin: 10px 0;
|
|
@@ -13,6 +13,7 @@
|
|
|
13
13
|
>
|
|
14
14
|
Explanation Details
|
|
15
15
|
</div>
|
|
16
|
+
<slot name="explanationTopExperiment"></slot>
|
|
16
17
|
<div
|
|
17
18
|
v-dark="isDarkMode"
|
|
18
19
|
v-breakpoint:questionEl="breakpoints"
|
|
@@ -233,6 +234,12 @@ export default class Explanation extends Vue {
|
|
|
233
234
|
margin-bottom: 24px;
|
|
234
235
|
word-break: break-word;
|
|
235
236
|
|
|
237
|
+
.keyword-highlight {
|
|
238
|
+
span {
|
|
239
|
+
font-size: 16.5px;
|
|
240
|
+
}
|
|
241
|
+
}
|
|
242
|
+
|
|
236
243
|
&--dark {
|
|
237
244
|
color: $white;
|
|
238
245
|
}
|