@pocketprep/ui-kit 3.8.4 → 3.9.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/dist/@pocketprep/ui-kit.css +1 -1
- package/dist/@pocketprep/ui-kit.js +14469 -17731
- package/dist/@pocketprep/ui-kit.js.map +1 -1
- package/dist/@pocketprep/ui-kit.umd.cjs +19 -29
- package/dist/@pocketprep/ui-kit.umd.cjs.map +1 -1
- package/eslint.config.ts +38 -11
- package/lib/SVGDefinitions.vue +32 -35
- package/lib/components/Banners/Banner.vue +10 -14
- package/lib/components/Blobs/Blob.vue +6 -14
- package/lib/components/Blobs/BlobEmptyState.vue +9 -8
- package/lib/components/Blobs/blob.d.ts +1 -1
- package/lib/components/BundleIcons/BundleIcon.vue +36 -63
- package/lib/components/BundleIcons/bundleIcon.d.ts +1 -1
- package/lib/components/Bundles/BundleList.vue +71 -59
- package/lib/components/Bundles/BundleSearch.vue +93 -117
- package/lib/components/Bundles/PremiumPill.vue +6 -12
- package/lib/components/Buttons/Button.vue +32 -35
- package/lib/components/Buttons/Link.vue +32 -31
- package/lib/components/Buttons/Tab.vue +14 -17
- package/lib/components/Calendar/Calendar.vue +87 -85
- package/lib/components/Charts/Bar.vue +192 -263
- package/lib/components/Charts/Pie.vue +55 -61
- package/lib/components/Charts/highcharts-wrap.ts +81 -0
- package/lib/components/Controls/SegmentControl.vue +26 -24
- package/lib/components/Controls/Slider.vue +51 -47
- package/lib/components/Controls/ToggleSwitch.vue +33 -31
- package/lib/components/EmptyStates/EmptyState.vue +69 -73
- package/lib/components/Exams/ExamCard.vue +59 -47
- package/lib/components/Exams/ExamMenuCard.vue +30 -28
- package/lib/components/Filters/FilterDropdown.vue +83 -86
- package/lib/components/Filters/FilterOptions.vue +83 -88
- package/lib/components/Forms/Checkbox.vue +27 -27
- package/lib/components/Forms/CheckboxOption.vue +30 -30
- package/lib/components/Forms/Errors.vue +21 -24
- package/lib/components/Forms/Input.vue +71 -59
- package/lib/components/Forms/Radio.vue +2 -2
- package/lib/components/Forms/RadioButton.vue +8 -8
- package/lib/components/Forms/Select.vue +265 -257
- package/lib/components/Forms/Textarea.vue +49 -35
- package/lib/components/Icons/IconAccordionArrow.vue +7 -9
- package/lib/components/Icons/IconActivity.vue +7 -9
- package/lib/components/Icons/IconAdd.vue +7 -11
- package/lib/components/Icons/IconAddCircle.vue +7 -9
- package/lib/components/Icons/IconArrow.vue +7 -9
- package/lib/components/Icons/IconBarChart.vue +7 -9
- package/lib/components/Icons/IconCalendar.vue +7 -9
- package/lib/components/Icons/IconCalendarPicker.vue +7 -9
- package/lib/components/Icons/IconChat.vue +7 -9
- package/lib/components/Icons/IconCheck.vue +7 -9
- package/lib/components/Icons/IconClose.vue +7 -9
- package/lib/components/Icons/IconConcept.vue +1 -1
- package/lib/components/Icons/IconCorrect.vue +7 -9
- package/lib/components/Icons/IconEdit.vue +7 -11
- package/lib/components/Icons/IconExam.vue +7 -9
- package/lib/components/Icons/IconExternalLink.vue +7 -9
- package/lib/components/Icons/IconEyeHide.vue +7 -9
- package/lib/components/Icons/IconEyeShow.vue +7 -9
- package/lib/components/Icons/IconFilter.vue +7 -9
- package/lib/components/Icons/IconFilterActive.vue +7 -9
- package/lib/components/Icons/IconFlag.vue +7 -9
- package/lib/components/Icons/IconFlagContent.vue +8 -9
- package/lib/components/Icons/IconFlagFeedback.vue +8 -10
- package/lib/components/Icons/IconFlagFilled.vue +7 -9
- package/lib/components/Icons/IconFullView.vue +7 -9
- package/lib/components/Icons/IconFullViewActive.vue +7 -9
- package/lib/components/Icons/IconGridDrag.vue +2 -2
- package/lib/components/Icons/IconHandle.vue +7 -9
- package/lib/components/Icons/IconHeart.vue +7 -9
- package/lib/components/Icons/IconHelp.vue +7 -9
- package/lib/components/Icons/IconHighlight.vue +2 -2
- package/lib/components/Icons/IconHourglass.vue +7 -9
- package/lib/components/Icons/IconImage.vue +7 -9
- package/lib/components/Icons/IconIncorrect.vue +7 -9
- package/lib/components/Icons/IconInfo.vue +7 -9
- package/lib/components/Icons/IconKeyboard.vue +7 -9
- package/lib/components/Icons/IconLaunch.vue +7 -9
- package/lib/components/Icons/IconLevelUp.vue +7 -9
- package/lib/components/Icons/IconLightbulb.vue +7 -9
- package/lib/components/Icons/IconLightning.vue +7 -9
- package/lib/components/Icons/IconLink.vue +7 -9
- package/lib/components/Icons/IconList.vue +7 -9
- package/lib/components/Icons/IconLoading.vue +7 -9
- package/lib/components/Icons/IconLoading2.vue +11 -11
- package/lib/components/Icons/IconLock.vue +7 -9
- package/lib/components/Icons/IconMissedQuestions.vue +7 -9
- package/lib/components/Icons/IconMoon.vue +7 -9
- package/lib/components/Icons/IconPaginationArrow.vue +7 -9
- package/lib/components/Icons/IconPaginationArrowDouble.vue +7 -9
- package/lib/components/Icons/IconPassage.vue +7 -9
- package/lib/components/Icons/IconPencil.vue +7 -9
- package/lib/components/Icons/IconPeople.vue +7 -9
- package/lib/components/Icons/IconPercent.vue +7 -9
- package/lib/components/Icons/IconPerson.vue +8 -9
- package/lib/components/Icons/IconPresent.vue +7 -9
- package/lib/components/Icons/IconPreview.vue +7 -9
- package/lib/components/Icons/IconQuestions.vue +7 -9
- package/lib/components/Icons/IconQuick10.vue +7 -9
- package/lib/components/Icons/IconQuickActions.vue +2 -2
- package/lib/components/Icons/IconRecommendedFilter.vue +1 -1
- package/lib/components/Icons/IconRemoveCircle.vue +7 -9
- package/lib/components/Icons/IconReviewFlag.vue +7 -9
- package/lib/components/Icons/IconSearch.vue +7 -9
- package/lib/components/Icons/IconShare.vue +7 -9
- package/lib/components/Icons/IconSideBar.vue +7 -9
- package/lib/components/Icons/IconSideBarActive.vue +7 -9
- package/lib/components/Icons/IconStar.vue +1 -1
- package/lib/components/Icons/IconStopwatch.vue +7 -9
- package/lib/components/Icons/IconStrike.vue +7 -9
- package/lib/components/Icons/IconSubject.vue +7 -9
- package/lib/components/Icons/IconText.vue +7 -9
- package/lib/components/Icons/IconTimer.vue +8 -9
- package/lib/components/Icons/IconWarning.vue +7 -9
- package/lib/components/Icons/icon.d.ts +1 -1
- package/lib/components/Loaders/SkeletonLoader.vue +1 -5
- package/lib/components/Modal/Modal.vue +23 -29
- package/lib/components/Modal/ModalContainer.vue +135 -133
- package/lib/components/Onboarding/EmailAuth.vue +66 -70
- package/lib/components/Onboarding/MagicCodeEntry.vue +88 -83
- package/lib/components/Pagination/QuestionReviewPagination.vue +3 -3
- package/lib/components/Pagination/TablePagination.vue +47 -44
- package/lib/components/PhonePerson/PhonePerson.vue +18 -18
- package/lib/components/PhonePerson/phonePerson.d.ts +1 -1
- package/lib/components/Quiz/FlagToggle.vue +45 -44
- package/lib/components/Quiz/GlobalMetricsToggle.vue +29 -28
- package/lib/components/Quiz/KeyboardShortcutsButton.vue +16 -23
- package/lib/components/Quiz/KeyboardShortcutsModal.vue +36 -37
- package/lib/components/Quiz/Question/BuildListChoicesContainer.vue +65 -65
- package/lib/components/Quiz/Question/ChoicesContainer.vue +5 -5
- package/lib/components/Quiz/Question/DropdownExplanation.vue +5 -5
- package/lib/components/Quiz/Question/Explanation.vue +6 -6
- package/lib/components/Quiz/Question/MPMCChoicesContainer.vue +17 -17
- package/lib/components/Quiz/Question/MPMCRadioGroup.vue +2 -2
- package/lib/components/Quiz/Question/MatrixChoicesContainer.vue +39 -39
- package/lib/components/Quiz/Question/MatrixRadioGroup.vue +6 -6
- package/lib/components/Quiz/Question/MobileMatrixChoicesContainer.vue +27 -28
- package/lib/components/Quiz/Question/MobileMatrixRadioGroup.vue +2 -2
- package/lib/components/Quiz/Question/PassageAndImage.vue +3 -3
- package/lib/components/Quiz/Question/PassageAndImageDropdown.vue +7 -7
- package/lib/components/Quiz/Question/Paywall.vue +2 -2
- package/lib/components/Quiz/Question/QuestionContext.vue +1 -1
- package/lib/components/Quiz/Question/StatsSummary.vue +2 -2
- package/lib/components/Quiz/Question/Summary.vue +11 -11
- package/lib/components/Quiz/Question.vue +90 -82
- package/lib/components/Quiz/QuizContainer.vue +1 -1
- package/lib/components/Quiz/QuizProgressBar.vue +23 -23
- package/lib/components/Quiz/question.d.ts +3 -3
- package/lib/components/Search/Pill.vue +16 -19
- package/lib/components/Search/Search.vue +52 -47
- package/lib/components/SidePanels/SidePanel.vue +168 -174
- package/lib/components/Tables/Table.vue +135 -122
- package/lib/components/Tables/TableActions.vue +81 -76
- package/lib/components/Tables/table.d.ts +1 -1
- package/lib/components/Tags/Tag.vue +49 -39
- package/lib/components/Toasts/Toast.vue +44 -42
- package/lib/components/Tooltips/OverflowTooltip.vue +39 -45
- package/lib/components/Tooltips/Tooltip.vue +69 -70
- package/lib/directives.ts +4 -4
- package/lib/utils.ts +13 -12
- package/package.json +27 -28
|
@@ -34,7 +34,7 @@
|
|
|
34
34
|
<Tooltip
|
|
35
35
|
class="uikit-calendar__clear-date-tooltip"
|
|
36
36
|
v-if="showClearDateTooltip">Clear Date</Tooltip>
|
|
37
|
-
<Icon
|
|
37
|
+
<Icon
|
|
38
38
|
type="close"
|
|
39
39
|
@mouseenter="showClearDateTooltip = true"
|
|
40
40
|
@mouseleave="showClearDateTooltip = false"
|
|
@@ -61,134 +61,136 @@
|
|
|
61
61
|
</div>
|
|
62
62
|
</template>
|
|
63
63
|
|
|
64
|
-
<script lang="ts">
|
|
65
|
-
import { Vue, Component, Prop, Emit } from 'vue-facing-decorator'
|
|
64
|
+
<script setup lang="ts">
|
|
66
65
|
import PocketInput from '../Forms/Input.vue'
|
|
67
66
|
import Icon from '../Icons/Icon.vue'
|
|
68
67
|
import Tooltip from '../Tooltips/Tooltip.vue'
|
|
69
68
|
import Litepicker from 'litepicker'
|
|
70
69
|
import 'litepicker/dist/plugins/keyboardnav'
|
|
71
70
|
import type { DateTime } from 'litepicker/dist/types/datetime'
|
|
72
|
-
import { dark } from '../../directives'
|
|
73
|
-
import type
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
71
|
+
import { dark as vDark } from '../../directives'
|
|
72
|
+
import { nextTick, onBeforeUnmount, onMounted, ref, useTemplateRef, type ComponentPublicInstance } from 'vue'
|
|
73
|
+
|
|
74
|
+
const {
|
|
75
|
+
label = '',
|
|
76
|
+
labelSubtext = '',
|
|
77
|
+
placeholder = '',
|
|
78
|
+
modelValue = null,
|
|
79
|
+
isDarkMode,
|
|
80
|
+
disabled,
|
|
81
|
+
error,
|
|
82
|
+
} = defineProps<{
|
|
83
|
+
label?: string
|
|
84
|
+
labelSubtext?: string
|
|
85
|
+
placeholder?: string
|
|
86
|
+
modelValue?: Date | null
|
|
87
|
+
isDarkMode?: boolean
|
|
88
|
+
disabled?: boolean
|
|
89
|
+
error?: boolean
|
|
90
|
+
}>()
|
|
91
|
+
|
|
92
|
+
const emit = defineEmits<{
|
|
93
|
+
'update:modelValue': [calendarInput: Date | null]
|
|
94
|
+
}>()
|
|
95
|
+
|
|
96
|
+
const calendarInstance = ref<null | Litepicker>(null)
|
|
97
|
+
const calendarInput = ref<Date | null>(null)
|
|
98
|
+
const dateString = ref('')
|
|
99
|
+
const hover = ref(false)
|
|
100
|
+
const isShowingCalendar = ref(false)
|
|
101
|
+
const showClearDateTooltip = ref(false)
|
|
102
|
+
const calendarRef = useTemplateRef<HTMLElement>('calendar')
|
|
103
|
+
const calendarInputContainer = useTemplateRef<ComponentPublicInstance>('calendarInput')
|
|
104
|
+
|
|
105
|
+
onBeforeUnmount(() => {
|
|
106
|
+
calendarInstance.value?.destroy()
|
|
84
107
|
})
|
|
85
|
-
export default class Calendar extends Vue {
|
|
86
|
-
@Prop() label!: string
|
|
87
|
-
@Prop() labelSubtext?: string
|
|
88
|
-
@Prop({ default: '' }) placeholder!: string
|
|
89
|
-
@Prop() modelValue!: Date | null
|
|
90
|
-
@Prop({ default: false }) isDarkMode!: boolean
|
|
91
|
-
@Prop({ default: false }) disabled!: boolean
|
|
92
|
-
@Prop({ default: false }) error!: boolean
|
|
93
|
-
|
|
94
|
-
calendar: null | Litepicker = null
|
|
95
|
-
calendarInput: Date | null = null
|
|
96
|
-
dateString = ''
|
|
97
|
-
hover = false
|
|
98
|
-
isShowingCalendar = false
|
|
99
|
-
afterCalendarTab = -1
|
|
100
|
-
showClearDateTooltip = false
|
|
101
|
-
|
|
102
|
-
beforeUnmount () {
|
|
103
|
-
this.calendar?.destroy()
|
|
104
|
-
}
|
|
105
108
|
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
109
|
+
onMounted(() => {
|
|
110
|
+
calendarInput.value = modelValue
|
|
111
|
+
dateString.value = modelValue ? modelValue.toLocaleDateString() : ''
|
|
112
|
+
if (calendarRef.value) {
|
|
113
|
+
calendarInstance.value = new Litepicker({
|
|
114
|
+
element: calendarRef.value,
|
|
111
115
|
plugins: [ 'keyboardnav' ],
|
|
112
116
|
firstDay: 0,
|
|
113
117
|
setup: picker => {
|
|
114
118
|
picker.on('selected', (date: DateTime) => {
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
119
|
+
calendarInput.value = date.toJSDate()
|
|
120
|
+
dateString.value = calendarInput.value.toLocaleDateString()
|
|
121
|
+
emitUpdateModelValue(calendarInput.value)
|
|
118
122
|
})
|
|
119
123
|
picker.on('clear:selection', () => {
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
124
|
+
calendarInput.value = null
|
|
125
|
+
dateString.value = ''
|
|
126
|
+
emitUpdateModelValue(calendarInput.value)
|
|
123
127
|
picker.hide()
|
|
124
128
|
})
|
|
125
129
|
picker.on('show', () => {
|
|
126
|
-
|
|
130
|
+
nextTick(() => {
|
|
127
131
|
const calendarEls = Array.from<HTMLElement>(document.querySelectorAll('.litepicker'))
|
|
128
132
|
const visibleCalendarEl = calendarEls.find(el => el.getBoundingClientRect().height)
|
|
129
133
|
const focusableEl = visibleCalendarEl?.querySelector(
|
|
130
134
|
'button, [href], input, select, textarea, [tabindex]:not([tabindex="-1"])'
|
|
131
135
|
) as HTMLElement
|
|
132
136
|
focusableEl.focus()
|
|
133
|
-
|
|
137
|
+
isShowingCalendar.value = true
|
|
134
138
|
})
|
|
135
139
|
})
|
|
136
140
|
picker.on('hide', () => {
|
|
137
|
-
const
|
|
138
|
-
const calendarInputContainerEl = calendarInputContainer?.$el as HTMLDivElement | undefined
|
|
141
|
+
const calendarInputContainerEl = calendarInputContainer.value?.$el as HTMLDivElement | undefined
|
|
139
142
|
const calendarInputEl = calendarInputContainerEl?.querySelector('input')
|
|
140
143
|
calendarInputEl?.focus()
|
|
141
144
|
calendarInputEl?.blur()
|
|
142
|
-
|
|
145
|
+
isShowingCalendar.value = false
|
|
143
146
|
})
|
|
144
147
|
},
|
|
145
148
|
})
|
|
146
149
|
}
|
|
150
|
+
})
|
|
147
151
|
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
}
|
|
152
|
-
|
|
153
|
-
this.calendar?.clearSelection()
|
|
152
|
+
const clearCalendar = () => {
|
|
153
|
+
if (disabled) {
|
|
154
|
+
return
|
|
154
155
|
}
|
|
155
156
|
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
return
|
|
159
|
-
}
|
|
157
|
+
calendarInstance.value?.clearSelection()
|
|
158
|
+
}
|
|
160
159
|
|
|
161
|
-
|
|
160
|
+
const showCalendar = () => {
|
|
161
|
+
if (disabled) {
|
|
162
|
+
return
|
|
162
163
|
}
|
|
163
164
|
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
this.clearCalendar()
|
|
167
|
-
return
|
|
168
|
-
}
|
|
169
|
-
if (![ 'Shift', 'Tab' ].includes(event.key)) {
|
|
170
|
-
if (!this.isShowingCalendar) {
|
|
171
|
-
this.showCalendar()
|
|
172
|
-
}
|
|
173
|
-
event.stopPropagation()
|
|
174
|
-
event.preventDefault()
|
|
175
|
-
return false
|
|
176
|
-
}
|
|
177
|
-
}
|
|
165
|
+
calendarInstance.value?.show()
|
|
166
|
+
}
|
|
178
167
|
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
168
|
+
const handleInputKeydown = (event: KeyboardEvent) => {
|
|
169
|
+
if (event.key === 'Backspace') {
|
|
170
|
+
clearCalendar()
|
|
171
|
+
return
|
|
172
|
+
}
|
|
173
|
+
if (![ 'Shift', 'Tab' ].includes(event.key)) {
|
|
174
|
+
if (!isShowingCalendar.value) {
|
|
175
|
+
showCalendar()
|
|
184
176
|
}
|
|
177
|
+
event.stopPropagation()
|
|
178
|
+
event.preventDefault()
|
|
179
|
+
return false
|
|
185
180
|
}
|
|
181
|
+
}
|
|
186
182
|
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
183
|
+
const processDateString = () => {
|
|
184
|
+
const inputDate = new Date(dateString.value)
|
|
185
|
+
if (inputDate && inputDate.toLocaleDateString() !== calendarInput.value?.toLocaleDateString()) {
|
|
186
|
+
calendarInput.value = inputDate
|
|
187
|
+
emitUpdateModelValue(calendarInput.value)
|
|
190
188
|
}
|
|
191
189
|
}
|
|
190
|
+
|
|
191
|
+
const emitUpdateModelValue = (newCalendarInput: Date | null) => {
|
|
192
|
+
emit('update:modelValue', newCalendarInput)
|
|
193
|
+
}
|
|
192
194
|
</script>
|
|
193
195
|
|
|
194
196
|
<style lang="scss">
|
|
@@ -291,4 +293,4 @@ export default class Calendar extends Vue {
|
|
|
291
293
|
}
|
|
292
294
|
}
|
|
293
295
|
}
|
|
294
|
-
</style>
|
|
296
|
+
</style>
|