diff --git a/app/components/PackageDownloadAnalytics.vue b/app/components/PackageDownloadAnalytics.vue index afb474a062..ab1b72bbd3 100644 --- a/app/components/PackageDownloadAnalytics.vue +++ b/app/components/PackageDownloadAnalytics.vue @@ -49,8 +49,6 @@ watch( const isDarkMode = computed(() => resolvedMode.value === 'dark') -// oklh or css variables are not supported by vue-data-ui (for now) - const accentColorValueById = computed>(() => { const map: Record = {} for (const item of accentColors) { diff --git a/app/components/PackageWeeklyDownloadStats.vue b/app/components/PackageWeeklyDownloadStats.vue index fd1a1e7c61..f9cee72fa1 100644 --- a/app/components/PackageWeeklyDownloadStats.vue +++ b/app/components/PackageWeeklyDownloadStats.vue @@ -116,10 +116,32 @@ const dataset = computed(() => const lastDatapoint = computed(() => dataset.value.at(-1)?.period ?? '') -// oklh or css variables are not supported by vue-data-ui (for now) const config = computed(() => { return { theme: 'dark', + /** + * The built-in skeleton loader kicks in when the component is mounted but the data is not yet ready. + * The configuration of the skeleton is customized for a seemless transition with the final state + */ + skeletonConfig: { + style: { + backgroundColor: 'transparent', + dataLabel: { + show: true, + color: 'transparent', + }, + area: { + color: colors.value.borderHover, + useGradient: false, + opacity: 10, + }, + line: { + color: colors.value.borderHover, + }, + }, + }, + // Same idea: initialize the line at zero, so it nicely transitions to the final dataset + skeletonDataset: Array.from({ length: 52 }, () => 0), style: { backgroundColor: 'transparent', animation: { show: false }, @@ -196,16 +218,21 @@ const config = computed(() => {
- + + +