-
-
Notifications
You must be signed in to change notification settings - Fork 425
Expand file tree
/
Copy pathVersionDistribution.vue
More file actions
710 lines (646 loc) · 24 KB
/
VersionDistribution.vue
File metadata and controls
710 lines (646 loc) · 24 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
<script setup lang="ts">
import { VueUiXy } from 'vue-data-ui/vue-ui-xy'
import { type VueUiXyDatasetItem, type VueUiXyConfig } from 'vue-data-ui'
import { useElementSize } from '@vueuse/core'
import { useCssVariables } from '~/composables/useColors'
import { OKLCH_NEUTRAL_FALLBACK, transparentizeOklch, lightenHex } from '~/utils/colors'
import {
drawSvgPrintLegend,
drawNpmxLogoAndTaglineWatermark,
} from '~/composables/useChartWatermark'
import TooltipApp from '~/components/Tooltip/App.vue'
import { copyAltTextForVersionsBarChart, sanitise, loadFile, applyEllipsis } from '~/utils/charts'
import('vue-data-ui/style.css')
const props = defineProps<{
packageName: string
inModal?: boolean
}>()
const { accentColors, selectedAccentColor } = useAccentColor()
const { copy, copied } = useClipboard()
const colorMode = useColorMode()
const resolvedMode = shallowRef<'light' | 'dark'>('light')
const rootEl = shallowRef<HTMLElement | null>(null)
onMounted(async () => {
rootEl.value = document.documentElement
resolvedMode.value = colorMode.value === 'dark' ? 'dark' : 'light'
})
const { colors } = useCssVariables(
['--bg', '--fg', '--bg-subtle', '--bg-elevated', '--fg-subtle', '--border', '--border-subtle'],
{
element: rootEl,
watchHtmlAttributes: true,
watchResize: false,
},
)
watch(
() => colorMode.value,
value => {
resolvedMode.value = value === 'dark' ? 'dark' : 'light'
},
{ flush: 'sync' },
)
const isDarkMode = computed(() => resolvedMode.value === 'dark')
const accentColorValueById = computed<Record<string, string>>(() => {
const map: Record<string, string> = {}
for (const item of accentColors.value) {
map[item.id] = item.value
}
return map
})
const accent = computed(() => {
const id = selectedAccentColor.value
return id
? (accentColorValueById.value[id] ?? colors.value.fgSubtle ?? OKLCH_NEUTRAL_FALLBACK)
: (colors.value.fgSubtle ?? OKLCH_NEUTRAL_FALLBACK)
})
const watermarkColors = computed(() => ({
fg: colors.value.fg ?? OKLCH_NEUTRAL_FALLBACK,
bg: colors.value.bg ?? OKLCH_NEUTRAL_FALLBACK,
fgSubtle: colors.value.fgSubtle ?? OKLCH_NEUTRAL_FALLBACK,
}))
const { width } = useElementSize(rootEl)
const mobileBreakpointWidth = 640
const isMobile = computed(() => width.value > 0 && width.value < mobileBreakpointWidth)
const {
groupingMode,
showRecentOnly,
showLowUsageVersions,
pending,
error,
chartDataset,
hasData,
} = useVersionDistribution(() => props.packageName)
const compactNumberFormatter = useCompactNumberFormatter()
// Show loading indicator immediately to maintain stable layout
const showLoadingIndicator = computed(() => pending.value)
const { locale } = useI18n()
function formatDate(date: Date) {
return date.toLocaleString(locale.value, {
month: 'short',
day: 'numeric',
timeZone: 'UTC',
})
}
const endDate = computed(() => {
const t = new Date()
return new Date(Date.UTC(t.getUTCFullYear(), t.getUTCMonth(), t.getUTCDate() - 1))
})
const startDate = computed(() => {
const start = new Date(endDate.value)
start.setUTCDate(start.getUTCDate() - 6)
return start
})
const { t } = useI18n()
const dateRangeLabel = computed(() => {
const from = formatDate(startDate.value)
const to = formatDate(endDate.value)
const endYear = endDate.value.getUTCFullYear()
const startYear = startDate.value.getUTCFullYear()
if (startYear !== endYear) {
return t('package.versions.distribution_range_date_multiple_years', {
from,
to,
startYear,
endYear,
})
}
return t('package.versions.distribution_range_date_same_year', { from, to, endYear })
})
function buildExportFilename(extension: string): string {
const range = dateRangeLabel.value.replaceAll(' ', '_').replaceAll(',', '')
const label = applyEllipsis(props.packageName, 32)
return `${sanitise(label ?? '')}_${range}.${extension}`
}
// VueUiXy expects one series with multiple values for bar charts
const xyDataset = computed<VueUiXyDatasetItem[]>(() => {
if (!chartDataset.value.length) return []
return [
{
name: applyEllipsis(props.packageName, 32),
series: chartDataset.value.map(item => item.downloads),
type: 'bar' as const,
color: accent.value,
},
]
})
const xAxisLabels = computed(() => {
return chartDataset.value.map(item => item.name)
})
const hasMinimap = computed<boolean>(() => {
const series = xyDataset.value[0]?.series ?? []
return series.length > 6
})
const chartConfig = computed<VueUiXyConfig>(() => {
return {
theme: isDarkMode.value ? 'dark' : '',
a11y: {
translations: {
keyboardNavigation: $t(
'package.trends.chart_assistive_text.keyboard_navigation_horizontal',
),
tableAvailable: $t('package.trends.chart_assistive_text.table_available'),
tableCaption: $t('package.trends.chart_assistive_text.table_caption'),
},
},
chart: {
title: {
text: dateRangeLabel.value,
fontSize: isMobile.value ? 24 : 16,
bold: false,
},
height: isMobile.value ? 750 : hasMinimap.value ? 500 : 611,
backgroundColor: colors.value.bg,
padding: {
top: 24,
right: 24,
bottom: 60,
},
userOptions: {
buttons: {
pdf: false,
labels: false,
fullscreen: false,
table: false,
tooltip: false,
altCopy: true,
},
buttonTitles: {
csv: $t('package.trends.download_file', { fileType: 'CSV' }),
img: $t('package.trends.download_file', { fileType: 'PNG' }),
svg: $t('package.trends.download_file', { fileType: 'SVG' }),
annotator: $t('package.trends.toggle_annotator'),
altCopy: $t('package.trends.copy_alt.button_label'), // Do not make this text dependant on the `copied` variable, since this would re-render the component, which is undesirable if the minimap was used to select a time frame.
open: $t('package.trends.open_options'),
close: $t('package.trends.close_options'),
},
callbacks: {
img: args => {
const imageUri = args?.imageUri
if (!imageUri) return
loadFile(imageUri, buildExportFilename('png'))
},
csv: csvStr => {
if (!csvStr) return
const PLACEHOLDER_CHAR = '\0'
const multilineDateTemplate = $t('package.trends.date_range_multiline', {
start: PLACEHOLDER_CHAR,
end: PLACEHOLDER_CHAR,
})
.replaceAll(PLACEHOLDER_CHAR, '')
.trim()
const blob = new Blob([
csvStr
.replace('data:text/csv;charset=utf-8,', '')
.replaceAll(`\n${multilineDateTemplate}`, ` ${multilineDateTemplate}`),
])
const url = URL.createObjectURL(blob)
loadFile(url, buildExportFilename('csv'))
URL.revokeObjectURL(url)
},
svg: args => {
const blob = args?.blob
if (!blob) return
const url = URL.createObjectURL(blob)
loadFile(url, buildExportFilename('svg'))
URL.revokeObjectURL(url)
},
altCopy: ({ dataset: dst, config: cfg }) =>
copyAltTextForVersionsBarChart({
dataset: dst,
config: {
...cfg,
datapointLabels: xAxisLabels.value,
dateRangeLabel: dateRangeLabel.value,
semverGroupingMode: groupingMode.value,
copy,
$t,
numberFormatter: compactNumberFormatter.value.format,
},
}),
},
},
grid: {
stroke: colors.value.border,
showHorizontalLines: true,
labels: {
fontSize: isMobile.value ? 24 : 16,
color: pending.value ? colors.value.border : colors.value.fgSubtle,
axis: {
yLabel: $t('package.versions.y_axis_label'),
yLabelOffsetX: 12,
fontSize: isMobile.value ? 32 : 24,
},
yAxis: {
formatter: ({ value }: { value: number }) => {
return compactNumberFormatter.value.format(Number.isFinite(value) ? value : 0)
},
useNiceScale: true,
},
xAxisLabels: {
show: xAxisLabels.value.length <= 25,
values: xAxisLabels.value,
fontSize: 16,
color: colors.value.fgSubtle,
},
},
},
highlighter: { useLine: false },
legend: { show: false, position: 'top' },
bar: {
periodGap: 16,
innerGap: 8,
borderRadius: 4,
},
tooltip: {
teleportTo: props.inModal ? '#chart-modal' : undefined,
borderColor: 'transparent',
backdropFilter: false,
backgroundColor: 'transparent',
customFormat: ({ datapoint, absoluteIndex, bars }) => {
if (!datapoint || pending.value) return ''
// Use absoluteIndex to get the correct version from chartDataset
const index = Number(absoluteIndex)
if (!Number.isInteger(index) || index < 0 || index >= chartDataset.value.length) return ''
const chartItem = chartDataset.value[index]
if (!chartItem) return ''
const barSeries = Array.isArray(bars?.[0]?.series) ? bars[0].series : []
const barValue = index < barSeries.length ? barSeries[index] : undefined
const raw = Number(barValue ?? chartItem.downloads ?? 0)
const v = compactNumberFormatter.value.format(Number.isFinite(raw) ? raw : 0)
return `<div class="font-mono text-xs p-3 border border-border rounded-md bg-[var(--bg)]/10 backdrop-blur-md">
<div class="flex flex-col gap-2">
<div class="flex items-center justify-between gap-4">
<span class="text-3xs tracking-wide text-[var(--fg)]/70">
${chartItem.name}
</span>
<span class="text-base text-[var(--fg)] font-mono tabular-nums">
${v}
</span>
</div>
</div>
</div>`
},
},
zoom: {
maxWidth: isMobile.value ? 350 : 500,
highlightColor: colors.value.bgElevated,
useResetSlot: true,
minimap: {
show: true,
lineColor: '#FAFAFA',
selectedColor: accent.value,
selectedColorOpacity: 0.06,
frameColor: colors.value.border,
handleWidth: isMobile.value ? 40 : 20, // does not affect the size of the touch area
handleBorderColor: colors.value.fgSubtle,
handleType: 'grab', // 'empty' | 'chevron' | 'arrow' | 'grab'
},
preview: {
fill: transparentizeOklch(accent.value, isDarkMode.value ? 0.95 : 0.92),
stroke: transparentizeOklch(accent.value, 0.5),
strokeWidth: 1,
strokeDasharray: 3,
},
},
},
}
})
</script>
<template>
<div
class="w-full flex flex-col"
id="version-distribution"
:aria-busy="pending ? 'true' : 'false'"
>
<div class="flex flex-col sm:flex-row gap-3 sm:gap-4 sm:items-end mb-6">
<div class="flex flex-col gap-1">
<label class="text-3xs font-mono text-fg-subtle tracking-wide uppercase">
{{ $t('package.versions.distribution_title') }}
</label>
<ButtonGroup>
<ButtonBase
@click="groupingMode = 'major'"
:variant="groupingMode === 'major' ? 'primary' : 'secondary'"
>
{{ $t('package.versions.grouping_major') }}
</ButtonBase>
<ButtonBase
@click="groupingMode = 'minor'"
:variant="groupingMode === 'minor' ? 'primary' : 'secondary'"
>
{{ $t('package.versions.grouping_minor') }}
</ButtonBase>
</ButtonGroup>
</div>
<div class="flex flex-col gap-1">
<label
class="text-3xs font-mono text-fg-subtle tracking-wide uppercase flex items-center gap-2"
>
<span>{{ $t('package.versions.grouping_versions_title') }}</span>
<TooltipApp
:text="$t('package.versions.recent_versions_only_tooltip')"
interactive
position="top"
:to="inModal ? '#chart-modal' : undefined"
:offset="8"
>
<span
tabindex="0"
class="i-lucide:info w-3.5 h-3.5 text-fg-subtle cursor-help shrink-0 rounded-sm"
role="img"
:aria-label="$t('package.versions.grouping_versions_about')"
/>
</TooltipApp>
</label>
<ButtonGroup>
<ButtonBase
@click="showRecentOnly = false"
:variant="showRecentOnly ? 'secondary' : 'primary'"
>
{{ $t('package.versions.grouping_versions_all') }}
</ButtonBase>
<ButtonBase
@click="showRecentOnly = true"
:variant="showRecentOnly ? 'primary' : 'secondary'"
>
{{ $t('package.versions.grouping_versions_only_recent') }}
</ButtonBase>
</ButtonGroup>
</div>
<div class="flex flex-col gap-1">
<label
class="text-3xs font-mono text-fg-subtle tracking-wide uppercase flex items-center gap-2"
>
<span>{{ $t('package.versions.grouping_usage_title') }}</span>
<TooltipApp
:text="$t('package.versions.show_low_usage_tooltip')"
interactive
position="top"
:to="inModal ? '#chart-modal' : undefined"
:offset="8"
>
<span
tabindex="0"
class="i-lucide:info w-3.5 h-3.5 text-fg-subtle cursor-help shrink-0 rounded-sm"
role="img"
:aria-label="$t('package.versions.grouping_usage_about')"
/>
</TooltipApp>
</label>
<ButtonGroup>
<ButtonBase
@click="showLowUsageVersions = false"
:variant="showLowUsageVersions ? 'secondary' : 'primary'"
>
{{ $t('package.versions.grouping_usage_most_used') }}
</ButtonBase>
<ButtonBase
@click="showLowUsageVersions = true"
:variant="showLowUsageVersions ? 'primary' : 'secondary'"
>
{{ $t('package.versions.grouping_usage_all') }}
</ButtonBase>
</ButtonGroup>
</div>
</div>
<h2 id="version-distribution-title" class="sr-only">
{{ $t('package.versions.distribution_title') }}
</h2>
<div
role="region"
aria-labelledby="version-distribution-title"
class="relative"
:class="isMobile ? 'min-h-[260px]' : 'min-h-[520px]'"
>
<!-- Chart content -->
<ClientOnly v-if="xyDataset.length > 0 && !error">
<div class="chart-container w-full" :key="groupingMode">
<VueUiXy :dataset="xyDataset" :config="chartConfig" class="[direction:ltr]">
<!-- Keyboard navigation hint -->
<template #hint="{ isVisible }">
<p v-if="isVisible" class="text-accent text-xs -mt-6 text-center" aria-hidden="true">
{{ $t('compare.packages.line_chart_nav_hint') }}
</p>
</template>
<!-- Injecting custom svg elements -->
<template #svg="{ svg }">
<!-- Inject legend during SVG print only -->
<g v-if="svg.isPrintingSvg" v-html="drawSvgPrintLegend(svg, watermarkColors)" />
<!-- Inject npmx logo & tagline during SVG and PNG print -->
<g
v-if="svg.isPrintingSvg || svg.isPrintingImg"
v-html="
drawNpmxLogoAndTaglineWatermark({
svg,
colors: watermarkColors,
translateFn: $t,
positioning: 'bottom',
})
"
/>
<!-- Overlay covering the chart area to hide line resizing when switching granularities recalculates VueUiXy scaleMax when estimation lines are necessary -->
<rect
v-if="pending"
:x="svg.drawingArea.left"
:y="svg.drawingArea.top - 12"
:width="svg.drawingArea.width + 12"
:height="svg.drawingArea.height + 48"
:fill="colors.bg"
/>
</template>
<!-- Custom bar gradient based on the series color -->
<template #bar-gradient="{ series, positiveId }">
<linearGradient :id="positiveId" x1="0" x2="0" y1="0" y2="1">
<!-- vue-data-ui exposes hex-normalized colors -->
<stop offset="0%" :stop-color="lightenHex(series.color, 0.618)" />
<stop offset="100%" :stop-color="series.color" stop-opacity="0.618" />
</linearGradient>
</template>
<!-- Custom legend for single series (non-interactive) -->
<template #legend="{ legend }">
<div class="flex gap-4 flex-wrap justify-center pt-8">
<template v-if="legend.length > 0">
<div class="flex gap-1 place-items-center">
<div class="h-3 w-3">
<svg viewBox="0 0 2 2" class="w-full">
<rect x="0" y="0" width="2" height="2" rx="0.3" :fill="legend[0]?.color" />
</svg>
</div>
<span>
{{ legend[0]?.name }}
</span>
</div>
</template>
</div>
</template>
<!-- Custom minimap reset button -->
<template #reset-action="{ reset: resetMinimap }">
<button
type="button"
aria-label="reset minimap"
class="absolute inset-is-1/2 -translate-x-1/2 -bottom-18 sm:inset-is-unset sm:translate-x-0 sm:bottom-auto sm:-inset-ie-20 sm:-top-3 flex items-center justify-center px-2.5 py-1.75 border border-transparent rounded-md text-fg-subtle hover:text-fg transition-colors hover:border-border focus-visible:outline-accent/70 sm:mb-0"
style="pointer-events: all !important"
@click="resetMinimap"
>
<span class="i-lucide:undo-2 w-5 h-5" aria-hidden="true" />
</button>
</template>
<!-- Contextual menu icon -->
<template #menuIcon="{ isOpen }">
<span v-if="isOpen" class="i-lucide:x w-6 h-6" aria-hidden="true" />
<span v-else class="i-lucide:ellipsis-vertical w-6 h-6" aria-hidden="true" />
</template>
<!-- Export options -->
<template #optionCsv>
<span class="text-fg-subtle font-mono pointer-events-none">CSV</span>
</template>
<template #optionImg>
<span class="text-fg-subtle font-mono pointer-events-none">PNG</span>
</template>
<template #optionSvg>
<span class="text-fg-subtle font-mono pointer-events-none">SVG</span>
</template>
<!-- Annotator action icons -->
<template #annotator-action-close>
<span
class="i-lucide:x w-6 h-6 text-fg-subtle"
style="pointer-events: none"
aria-hidden="true"
/>
</template>
<template #annotator-action-color="{ color }">
<span class="i-lucide:palette w-6 h-6" :style="{ color }" aria-hidden="true" />
</template>
<template #annotator-action-draw="{ mode }">
<span
v-if="mode === 'arrow'"
class="i-lucide:move-up-right text-fg-subtle w-6 h-6"
aria-hidden="true"
/>
<span
v-if="mode === 'text'"
class="i-lucide:type text-fg-subtle w-6 h-6"
aria-hidden="true"
/>
<span
v-if="mode === 'line'"
class="i-lucide:pen-line text-fg-subtle w-6 h-6"
aria-hidden="true"
/>
<span
v-if="mode === 'draw'"
class="i-lucide:line-squiggle text-fg-subtle w-6 h-6"
aria-hidden="true"
/>
</template>
<template #annotator-action-undo>
<span
class="i-lucide:undo-2 w-6 h-6 text-fg-subtle"
style="pointer-events: none"
aria-hidden="true"
/>
</template>
<template #annotator-action-redo>
<span
class="i-lucide:redo-2 w-6 h-6 text-fg-subtle"
style="pointer-events: none"
aria-hidden="true"
/>
</template>
<template #annotator-action-delete>
<span
class="i-lucide:trash w-6 h-6 text-fg-subtle"
style="pointer-events: none"
aria-hidden="true"
/>
</template>
<template #optionAnnotator="{ isAnnotator }">
<span
v-if="isAnnotator"
class="i-lucide:pen-off w-6 h-6 text-fg-subtle"
style="pointer-events: none"
aria-hidden="true"
/>
<span
v-else
class="i-lucide:pen w-6 h-6 text-fg-subtle"
style="pointer-events: none"
aria-hidden="true"
/>
</template>
<template #optionAltCopy>
<span
class="w-6 h-6"
:class="
copied ? 'i-lucide:check text-accent' : 'i-lucide:person-standing text-fg-subtle'
"
style="pointer-events: none"
aria-hidden="true"
/>
</template>
</VueUiXy>
</div>
<template #fallback>
<div />
</template>
</ClientOnly>
<!-- No-data state -->
<div v-if="!hasData && !pending && !error" class="flex items-center justify-center h-full">
<div class="text-sm text-fg-subtle font-mono text-center flex flex-col items-center gap-2">
<span class="i-lucide:database w-8 h-8" />
<p>{{ $t('package.trends.no_data') }}</p>
</div>
</div>
<!-- Error state -->
<div v-if="error" class="flex items-center justify-center h-full" role="alert">
<div class="text-sm text-fg-subtle font-mono text-center flex flex-col items-center gap-2">
<span class="i-lucide:octagon-alert w-8 h-8 text-red-400" />
<p>{{ error.message }}</p>
<p class="text-xs">Package: {{ packageName }}</p>
</div>
</div>
<!-- Loading indicator as true overlay -->
<div
v-if="showLoadingIndicator"
role="status"
aria-live="polite"
class="absolute top-1/2 inset-is-1/2 -translate-x-1/2 -translate-y-1/2"
>
<div
class="text-xs text-fg-subtle font-mono bg-bg/70 backdrop-blur px-3 py-2 rounded-md border border-border"
>
{{ $t('common.loading') }}
</div>
</div>
</div>
</div>
</template>
<style scoped>
/* Disable all transitions on SVG elements to prevent repositioning animation */
:deep(.vue-ui-xy) svg rect {
transition: none !important;
}
:deep(.vue-data-ui-component svg:focus-visible) {
outline: 1px solid var(--accent-color) !important;
border-radius: 0.1rem;
outline-offset: 0 !important;
}
:deep(.vue-ui-user-options-button:focus-visible),
:deep(.vue-ui-user-options :first-child:focus-visible) {
outline: 0.1rem solid var(--accent-color) !important;
border-radius: 0.25rem;
}
</style>
<style>
/* Override default placement of the refresh button to have it to the minimap's side */
@media screen and (min-width: 767px) {
#version-distribution .vue-data-ui-refresh-button {
top: -0.6rem !important;
left: calc(100% + 4rem) !important;
}
}
/* Adds padding to graph title in absence of a configurable css property */
#version-distribution .atom-title {
padding-top: 20px;
}
</style>