Skip to content

Commit 93916a3

Browse files
committed
fix: adjust UI
1 parent 52ee98e commit 93916a3

File tree

4 files changed

+18
-16
lines changed

4 files changed

+18
-16
lines changed

packages/vite/src/app/components/display/HighlightedPackageName.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ export default defineComponent({
2525
const [scope, name] = packageName.split('/')
2626
return [
2727
h('span', { style: `color: ${color}` }, scope),
28-
h('span', { style: `color: ${color}` }, '/'),
28+
h('span', { style: `color: ${color}`, class: 'op50' }, '/'),
2929
h('span', { style: `color: ${color}` }, name),
3030
]
3131
}

packages/vite/src/app/components/packages/Importers.vue

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
<script setup lang="ts">
22
import type { PackageInfo, SessionContext } from '~~/shared/types/data'
3-
import { DisplayNumberBadge } from '#components'
43
import { computed } from 'vue'
54
65
const props = defineProps<{
@@ -13,18 +12,18 @@ const importers = computed(() => [...new Set(props.package.files.filter(f => !!f
1312
</script>
1413

1514
<template>
16-
<div flex="~ row gap-1">
17-
<div flex="~ row gap-1">
15+
<div flex="~ row gap-1" of-hidden>
16+
<div flex="~ row gap-1" ws-nowrap>
1817
<DisplayModuleId :id="importers[0]!.path" :session="session" link />
1918
<DisplayBadge v-if="importers[0]!.version && showVersion" :text="importers[0]!.version" as="span" />
2019
</div>
21-
<VMenu v-if="importers.length > 1" :delay="{ show: 200, hide: 0 }">
22-
<DisplayNumberBadge :number="importers.length" class="text-blue dark:text-blue" />
20+
<VMenu v-if="importers.length > 1" :delay="{ show: 200, hide: 0 }" flex-none>
21+
<DisplayBadge :text="`+${importers.length}`" :color="100" class="text-xs rounded px1" />
2322
<template #popper>
2423
<div p2 flex="~ col gap-1">
2524
<div v-for="importer of importers" :key="importer.path" flex="~ row gap-1 items-center nowrap" w-max>
2625
<DisplayModuleId :id="importer.path" :session="session" ws-nowrap flex-1 disable-tooltip link />
27-
<DisplayBadge v-if="importer.version && showVersion" :text="importer.version" as="span" />
26+
<DisplayBadge v-if="importer.version && showVersion" :text="`v${importer.version}`" as="span" />
2827
</div>
2928
</div>
3029
</template>

packages/vite/src/app/components/packages/Table.vue

Lines changed: 10 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -25,28 +25,30 @@ function toggleSizeSortType() {
2525
</script>
2626

2727
<template>
28-
<div role="table" min-w-max border="~ base rounded">
28+
<div role="table" min-w-max border="~ base rounded-xl">
2929
<div role="row" class="border-b border-base" flex="~ row">
30-
<div :title="groupView ? 'Package' : 'Bundled packages'" role="columnheader" rounded-tl-2 bg-base flex-none ws-nowrap py1.5 px2 font-600 :class="[groupView ? 'min-w40' : 'min-w80']">
30+
<div :title="groupView ? 'Package' : 'Bundled packages'" role="columnheader" rounded-tl-2 flex-none ws-nowrap py1.5 px2 font-600 :class="[groupView ? 'min-w40' : 'min-w80']">
3131
<template v-if="groupView">
32-
<DisplayHighlightedPackageName :name="packages?.[0]?.name!" />
32+
<div font-mono>
33+
<DisplayHighlightedPackageName :name="packages?.[0]?.name!" />
34+
</div>
3335
</template>
3436
<template v-else>
3537
Package
3638
</template>
3739
</div>
38-
<div v-if="!groupView" title="Package version" role="columnheader" rounded-tr-2 bg-base flex-none min-w40 ws-nowrap text-left py1.5 px2 font-600>
40+
<div v-if="!groupView" title="Package version" role="columnheader" rounded-tr-2 flex-none min-w40 ws-nowrap text-left py1.5 px2 font-600>
3941
Version
4042
</div>
41-
<div title="Transformed code size" role="columnheader" rounded-tr-2 bg-base flex-none ws-nowrap py1.5 pl2 font-600 min-w40>
43+
<div title="Transformed code size" role="columnheader" rounded-tr-2 flex-none ws-nowrap py1.5 pl2 font-600 min-w40>
4244
<button flex="~ row gap1 items-center justify-end" w-full relative pr2>
4345
Size
4446
<span v-if="!disableSizeSort" w-6 h-6 rounded-full cursor-pointer hover="bg-active" flex="~ items-center justify-center" @click="toggleSizeSortType">
4547
<i text-xs :class="[sizeSortType !== 'asc' ? 'i-ph-arrow-down-duotone' : 'i-ph-arrow-up-duotone', sizeSortType ? 'op100 text-primary' : 'op50']" />
4648
</span>
4749
</button>
4850
</div>
49-
<div title="Importers" role="columnheader" rounded-tr-2 bg-base flex-none ws-nowrap py1.5 pl20 pr2 font-600 min-w50>
51+
<div title="Importers" role="columnheader" rounded-tr-2 flex-none ws-nowrap py1.5 pl20 pr2 font-600 min-w50>
5052
Importers
5153
</div>
5254
</div>
@@ -64,11 +66,12 @@ function toggleSizeSortType() {
6466
class="border-base border-b-1 border-dashed"
6567
:class="[index === packages.length - 1 ? 'border-b-0' : '']"
6668
>
67-
<div v-if="!groupView" role="cell" flex="~ items-center gap1" flex-none min-w80 py1.5 px2 ws-nowrap text-sm>
69+
<div v-if="!groupView" role="cell" font-mono flex-none min-w80 py1.5 px2 ws-nowrap text-sm>
6870
<DisplayHighlightedPackageName :name="item.name" />
6971
</div>
7072
<div role="cell" flex="~ items-center" text-left flex-none font-mono py1.5 px2 text-sm min-w40 op80>
7173
{{ item.version }}
74+
<!-- TODO: color this if the package is duplicated -->
7275
</div>
7376
<div role="cell" flex="~ items-center justify-end" flex-none font-mono py1.5 px2 text-sm min-w40 op80>
7477
<VMenu :delay="{ show: 200, hide: 0 }">

packages/vite/src/app/pages/session/[session]/packages.vue

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,7 @@ const duplicatePackagesCount = computed(() => {
6767
}, {} as Record<string, number>)).filter(count => count > 1).length
6868
})
6969
70-
const packageViewTpyes = computed(() => [
70+
const packageViewTypes = computed(() => [
7171
{
7272
label: 'Table',
7373
value: 'table',
@@ -150,7 +150,7 @@ watch(() => settings.value.packageViewType, () => {
150150
<div flex="~ gap-2 items-center" p2 border="t base">
151151
<span op50 pl2 text-sm>View as</span>
152152
<button
153-
v-for="viewType of packageViewTpyes"
153+
v-for="viewType of packageViewTypes"
154154
:key="viewType.value"
155155
btn-action
156156
:class="settings.packageViewType === viewType.value ? 'bg-active' : 'grayscale op50'"

0 commit comments

Comments
 (0)