-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
@@ -65,6 +59,17 @@
+
+
+
@@ -198,9 +203,9 @@
+
+
+
+
+
+
+
+
-
+
@@ -382,7 +387,6 @@
/* Mobile: single column, sidebar above readme */
grid-template-columns: minmax(0, 1fr);
grid-template-areas:
- 'header'
'details'
'install'
'vulns'
@@ -390,12 +394,11 @@
'readme';
}
-/* Tablet/medium: header/install/vulns full width, readme+sidebar side by side */
+/* Tablet/medium: install/vulns full width, readme+sidebar side by side */
@media (min-width: 1024px) {
.package-page {
grid-template-columns: 2fr 1fr;
grid-template-areas:
- 'header header'
'details details'
'install install'
'vulns vulns'
@@ -409,7 +412,6 @@
.package-page {
grid-template-columns: 1fr 20rem;
grid-template-areas:
- 'header sidebar'
'details sidebar'
'install sidebar'
'vulns sidebar'
@@ -417,10 +419,6 @@
}
}
-.area-header {
- grid-area: header;
-}
-
.area-details {
grid-area: details;
}
@@ -441,39 +439,4 @@
.area-sidebar {
grid-area: sidebar;
}
-
-/* Sidebar scrollbar: hidden by default, shown on hover/focus */
-@media (min-width: 1024px) {
- .sidebar-scroll {
- scrollbar-gutter: stable;
- scrollbar-width: 8px;
- scrollbar-color: transparent transparent;
- }
-
- .sidebar-scroll::-webkit-scrollbar {
- width: 8px;
- height: 8px;
- }
-
- .sidebar-scroll::-webkit-scrollbar-track,
- .sidebar-scroll::-webkit-scrollbar-thumb {
- background: transparent;
- }
-
- .sidebar-scroll:hover,
- .sidebar-scroll:focus-within {
- scrollbar-color: var(--border) transparent;
- }
-
- .sidebar-scroll:hover::-webkit-scrollbar-thumb,
- .sidebar-scroll:focus-within::-webkit-scrollbar-thumb {
- background-color: var(--border);
- border-radius: 9999px;
- }
-
- .sidebar-scroll:hover::-webkit-scrollbar-track,
- .sidebar-scroll:focus-within::-webkit-scrollbar-track {
- background: transparent;
- }
-}
diff --git a/app/components/VersionSelector.vue b/app/components/VersionSelector.vue
index 5a0867ee8a..46d29d8624 100644
--- a/app/components/VersionSelector.vue
+++ b/app/components/VersionSelector.vue
@@ -11,14 +11,21 @@ import {
} from '~/utils/versions'
import { fetchAllPackageVersions } from '~/utils/npm/api'
-const props = defineProps<{
- packageName: string
- currentVersion: string
- versions: Record
- distTags: Record
- /** URL pattern for navigation. Use {version} as placeholder. */
- urlPattern: string
-}>()
+const props = withDefaults(
+ defineProps<{
+ packageName: string
+ currentVersion: string
+ versions: Record
+ distTags: Record
+ /** URL pattern for navigation. Use {version} as placeholder. */
+ urlPattern: string
+ /** class for the position of the dropdown, default is inset-is-0 */
+ positionClass?: string | null
+ }>(),
+ {
+ positionClass: 'inset-is-0',
+ },
+)
const isOpen = shallowRef(false)
const dropdownRef = useTemplateRef('dropdownRef')
@@ -472,19 +479,20 @@ watch(
type="button"
aria-haspopup="listbox"
:aria-expanded="isOpen"
- class="flex items-center gap-1.5 text-fg-subtle font-mono text-sm hover:text-fg transition-[color] focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 focus-visible:ring-offset-bg rounded"
+ class="break-all text-start text-fg-subtle font-mono text-sm hover:text-fg transition-[color] focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 focus-visible:ring-offset-bg rounded"
@click="isOpen = !isOpen"
@keydown="handleButtonKeydown"
+ data-testid="version-selector-button"
>
- {{ currentVersion }}
+ {{ currentVersion }}
latest
@@ -506,7 +514,8 @@ watch(
:aria-activedescendant="
focusedIndex >= 0 ? `version-${flatItems[focusedIndex]?.version?.version}` : undefined
"
- class="absolute top-full inset-is-0 mt-2 min-w-[220px] bg-bg-subtle/80 backdrop-blur-sm border border-border-subtle rounded-lg shadow-lg shadow-fg-subtle/10 z-50 py-1 max-h-[400px] overflow-y-auto overscroll-contain focus-visible:outline-none"
+ class="absolute top-full mt-2 min-w-[220px] max-w-[calc(100vw-40px)] bg-bg-subtle/80 backdrop-blur-sm border border-border-subtle rounded-lg shadow-lg shadow-fg-subtle/10 z-50 py-1 max-h-[400px] overflow-y-auto overscroll-contain focus-visible:outline-none"
+ :class="positionClass"
@keydown="handleListboxKeydown"
>
diff --git a/app/components/diff/MobileSidebarDrawer.vue b/app/components/diff/MobileSidebarDrawer.vue
index 9fb48e5f7f..087bd4f6c8 100644
--- a/app/components/diff/MobileSidebarDrawer.vue
+++ b/app/components/diff/MobileSidebarDrawer.vue
@@ -1,10 +1,15 @@
-
-
-
-
-
+
{{ packageName }} API Documentation
- - -
-
-
-
-
-
- {{ packageName }}
-
-
-
- {{ resolvedVersion }}
-
-
-
-
- API Docs
-
-
-
+
@@ -213,13 +200,6 @@ const showEmptyState = computed(() => docsData.value?.status !== 'ok')